common: Add Deferred{Unique|Shared}Ptr and helpers
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 1 Nov 2016 16:23:44 +0000 (17:23 +0100)
committerBen Rosser <rosser.bjr@gmail.com>
Sat, 27 May 2017 18:01:06 +0000 (14:01 -0400)
commit46f20e19a343ad0fa17dde6c32f17e60fc682c9b
treecb4763f185bb96ca5b5dcba119f087570d7938fb
parent423e088804d243368074ab218b2bda2fff3303c9
common: Add Deferred{Unique|Shared}Ptr and helpers

This commit adds smart pointers for holding QObject derivatives.
On destruction, they will deleteLater() the object they're holding.
This is the recommended and safe way for deleting QObject instances.
Be careful with using such smart pointers outside of the scope of
their parent, for objects that are owned. The parent will delete
its children, and any outside reference still held by a smart pointer
will lead to a double free!
src/common/deferredptr.h [new file with mode: 0644]