This nothing specific about QThreads, but normal C/C++ behaviour.
Case 1: In which you get warning, TestThread obejcts are created on stack, with local scope, compiler calls destructor at the end of main()
Case 2: In which no warning, TestThread obejcts are created on heap (dynamic object), compiler does not explicitly destroy this, you have write code to manually delete these objects on heap. Objects not destroyed - so no warnning.
Bookmarks