RFC: singletons and memory management
Seb Ruiz
ruiz at kde.org
Thu Sep 11 04:58:42 CEST 2008
2008/9/11 Soren Harward <stharward at gmail.com>:
> You could also use a "smart" pointer like
> auto_ptr or QPointer that automatically set to zero when they're
> deleted, but I personally prefer the static destroy() method. At any
> rate, the Singleton classes in Amarok should be a little smarter about
> their memory management.
Why do you prefer the destroy() method? The less a developer needs to
know to code the better. Introducing a destroy() method simply
"reinvents the bike", with the added overhead of needing to relearn
singleton object destruction.
--
Seb Ruiz
http://www.sebruiz.net/
http://amarok.kde.org/
More information about the Amarok-devel
mailing list