wxThread exit vs destructor

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Martin Silenus
In need of some credit
In need of some credit
Posts: 7
Joined: Tue Nov 05, 2019 8:33 pm

wxThread exit vs destructor

Post by Martin Silenus » Sat Nov 09, 2019 12:06 pm

Quick question on wxThreads :

It is said that detached threads destroy themselves upon completion. Threads also have a destructor. So does it make a difference if I put my clean-up code at the end of the Entry() function or in the destructor?

User avatar
doublemax
Moderator
Moderator
Posts: 14277
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxThread exit vs destructor

Post by doublemax » Sat Nov 09, 2019 4:39 pm

The "official" place for clean-up would be in wxThread::OnExit(). But i can't think of any reason why using the dtor could be a problem.
Use the source, Luke!

Post Reply