Yes, but this is another topic form what has been raised here.Rein Halbersma wrote: Proper RAII is to wrap the thread in a class (preferably a std::unique_ptr), where the constructor creates and the destructor cleans up. This way, whenever an exception happens after the thread has been created, the destructor is guaranteed to be called.
Please note that also in the previous code we used pointers to threads objects and so if not explicitly deleted we had a leak.
The fix discussed in this thread was for the call of a virtual function in the c'tor of a base class....and I think it has been fixed.
What you raise now is the concern about using a simple pointer instead of a smart pointer, here the reason is that I need to put them in a std::vector and std::auto_ptr is not compatible, I'd should use std::unique_ptr as you suggested, but this is C++11 stuff and the base version of SF is C++03 compatible, not C++11.
And, of course, I have absolutely no intention to build up my home grown, partial and ad-hoc smart pointer wrapper just to overcome this limitation. I prefer to live with the fact that if for some reason Threads.exit() is not called we have a leak, but if this happens it means the application is crashing anyhow.