Nominate our 2022 Qt Champions!

Stop QThread without event loop

  • Are there safer alternatives to terminate(); to stop Qthreads that have no event loops?
    On windows os have not managed to crash but with linux it crashes application always if using terminate();

    Threads are continiualy looped under while loops.
    One way may be to have condition for while loop to end looping but the loop is long and it would be better if instant stop.

  • Lifetime Qt Champion


    If you have long loop function break it in smaller logical parts and insert checks for the break condition variable between these logical parts.

Log in to reply