Boost logo

Boost Users :

From: Stephen Torri (storri_at_[hidden])
Date: 2007-05-17 11:01:24


On Thu, 2007-05-17 at 16:57 +0200, Hughes, James wrote:

> Wasn't sure about the get(), but with regard to the singleton itself,
> there is no real need to deallocate the singleton instance as the only
> memory leak is at the termination of the program and the memory is aonly
> allocated once, so there is no need to reference count the people using
> the singleton (which would be the purpose of the shared_ptr). I'd just
> be inclined to either use your original code, or go with the Meyers
> singleton which returns a reference (no pointers at all). Just take care
> if multi threaded.
>
> James

Right now the application is single threaded. I did that to keep things
simple. Its fast enough right now being designed that way. I will look
at the Meyers singleton. Thanks.

Stephen


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net