08.11.2014 Views

Memory Management - Poco

Memory Management - Poco

Memory Management - Poco

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Singletons<br />

> If you absolutely must have a singleton...<br />

> POCO provides a <strong>Poco</strong>::SingletonHolder class that helps with the<br />

thread-safe management of lazy-created singletons.<br />

> #include "<strong>Poco</strong>/SingletonHolder.h"<br />

> The singleton instance is created on the heap when it is<br />

requested for the first time.<br />

> The singleton instance is destroyed when the application<br />

terminates.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!