Skip to main content

Command Palette

Search for a command to run...

Stop QThread properly

Published
1 min read
Stop QThread properly
M

DevOps Engineer | Kubernetes | Python | Terraform | AWS | GCP

Are you annoyed with this message? When you try to terminate a thread while quitting the main application thread, and this weird message appears after the applications is closed?

QThread: Destroyed while thread is still running

Try adding QThread::wait() before quitting the application. For example,

thread->terminate();
thread->wait();
qApp->quit();

this will solve the problem for sure.

More from this blog

M

Minhaz's Blog

111 posts