diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-12-11 20:57:37 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-12-11 21:43:41 +0100 |
commit | 313e376d1712ac78b005ac3ee61c2a46b50952b5 (patch) | |
tree | c84d201385b9d75f3bda9389f8de4d36e04ac0cd /glib/glibmm/object.cc | |
parent | cb35307fa9e8ccdd4d18a0f508ca8887d740c940 (diff) | |
download | glibmm-refptr_as_sharedptr_v3.tar.gz |
Remove Glib::WeakRefrefptr_as_sharedptr_v3
Now that RefPtr is really a std::shared_ptr<>, we should use
std::weak_ref<> instead.
Note that a std::weak_ptr<> tells you nothing about whether
the underlying GObject is still alive, which Glib::RefPtr did.
It just tells you whether our std::shared_ptr<> still holds
a reference to it. That's why I removed one of the checks in
tests/giomm_listmodel/main.cc.
Diffstat (limited to 'glib/glibmm/object.cc')
-rw-r--r-- | glib/glibmm/object.cc | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/glib/glibmm/object.cc b/glib/glibmm/object.cc index 19f30d53..cb5e50b2 100644 --- a/glib/glibmm/object.cc +++ b/glib/glibmm/object.cc @@ -27,28 +27,6 @@ #include <string.h> -// Weak references: -// I'm not sure what the point of these are apart from being a hacky way out of circular references, -// but maybe we could make it easier to use them by making a Java Reference Object -style class like -// so: -// Glib::WeakRef<SomeDerivedObject> weakrefSomeObject(object1); -// ... -// if(weakrefSomeObject->isStillAlive()) -// { -// weakrefSomeObject->some_method(); -// } -// else -// { -// //Deal with it, maybe recreating the object. -// } -// -// Without this, the coder has to define his own signal handler which sets his own isStillAlive -// boolean. -// weakrefSomeObject<> could still have its own signal_destroyed signal so that coders can choose to -// deal -// with the destruction as soon as it happens instead of just checking later before they try to use -// it. - namespace Glib { |