Comment 18 for bug 1286611

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

Yes, that's a different and very valid reason for wanting to do it.
There's absolutely an advantage in making sure that destructors are correctly called.

As I've said from the start we already use uniqe_ptr in many places, that there are places where we probably should use it more, and likewise places where we wouldn't gain anything from using it.

I still don't fully understand what you want with this bug report. If it's "replace all raw pointers with unique_ptr" I don't agree, but if it's "replace raw pointers with unique_ptr where suitable" I'm for it.
But do note that you probably won't find many places where it's suitable. There are very few places where there can be unexpected and recoverable exceptions thrown in constructors.
We do not consider std::bad_alloc to be a recoverable exception, so there's no point in catching it or even try to write defensive code for it. The process will go down and then destructors being called or not doesn't matter.