[telepathy-qt4/master] WeakPtr: Fixed operator=(const SharedPtr &).

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Mar 31 12:46:55 PDT 2009


---
 TelepathyQt4/shared-ptr.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/TelepathyQt4/shared-ptr.h b/TelepathyQt4/shared-ptr.h
index 9038032..c4a2d1e 100644
--- a/TelepathyQt4/shared-ptr.h
+++ b/TelepathyQt4/shared-ptr.h
@@ -152,6 +152,7 @@ template <class T>
 class WeakPtr
 {
 public:
+    inline WeakPtr() : wd(0) { }
     inline WeakPtr(const WeakPtr<T> &o) : wd(o.wd) { if (wd) { wd->weakref.ref(); } }
     inline WeakPtr(const SharedPtr<T> &o)
     {
@@ -199,7 +200,7 @@ public:
     inline WeakPtr<T> &operator=(const SharedPtr<T> &o)
     {
         if (o.d) {
-            if (o.d->wd != wd) {
+            if (o.d->wd != wd || o.d->wd == 0) {
                 if (!o.d->wd) {
                     o.d->wd = new WeakData(o.d);
                 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list