diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2011-12-21 14:10:08 +0100 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2012-01-17 11:04:37 +0100 |
commit | 31e61c7200c7a7ec288fdc5c472118cd74e7576f (patch) | |
tree | d625e8fa8184d216693333110cea718ac34ba900 /src/syncevo/GLibSupport.cpp | |
parent | f88fe5acac55f2c37271ce3acf7bc76fe07e5899 (diff) |
GMainLoop smart pointer: moved to GLibSupport.h
Better use a shared pointer for GMainLoop. Avoids errors with ref
counting when coping an eptr and boost::intrusive_ptr has the same low
overhead.
Diffstat (limited to 'src/syncevo/GLibSupport.cpp')
-rw-r--r-- | src/syncevo/GLibSupport.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/syncevo/GLibSupport.cpp b/src/syncevo/GLibSupport.cpp index 4c9d3294..6c2719d4 100644 --- a/src/syncevo/GLibSupport.cpp +++ b/src/syncevo/GLibSupport.cpp @@ -251,7 +251,10 @@ class GLibTest : public CppUnit::TestFixture { list<Event> events; static const char *name = "GLibTest.out"; unlink(name); - GMainLoopPtr loop(g_main_loop_new(NULL, FALSE), "main loop"); + GMainLoopCXX loop(g_main_loop_new(NULL, FALSE), false); + if (!loop) { + SE_THROW("could not allocate main loop"); + } GLibNotify notify(name, boost::bind(notifyCallback, boost::ref(events), _1, _2, _3)); { events.clear(); |