summaryrefslogtreecommitdiff
path: root/src/syncevo/SyncContext.h
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2013-05-13 21:33:34 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2013-05-16 11:19:32 +0200
commitd3eee8a0390558795ace8be503b44d76be385b13 (patch)
tree1a6d9442af43632cb2e1db172653f97dd005c4b1 /src/syncevo/SyncContext.h
parentfb83c468a8ba554e40bb5fbb746154fd1d6cd0c2 (diff)
glib: stricter ref counting
Following the boost::instrusive_ptr example and making "add_ref = true" the default in our CXX GLib and GObject wrappers led to some memory leaks because it didn't enforce thinking about whether the plain pointer is already owned by us or not. It is better to use a mandatory enum value, ADD_REF and TRANSFER_REF, and force explicit construction. Doing that revealed that the assignment operator was implemented as constructing a CXX instance with increased ref count and/or that in some places, a real leak was caused by increasing the ref count unnecessarily. Running under valgrind gave a false sense of security. Some of the real leaks only showed up randomly in tests.
Diffstat (limited to 'src/syncevo/SyncContext.h')
0 files changed, 0 insertions, 0 deletions