From 7e2dafdcb8ee701edfe18bcada0e4f0a27c895a0 Mon Sep 17 00:00:00 2001 From: frohlich Date: Wed, 16 Sep 2009 05:04:05 +0000 Subject: [PATCH] Make the weak pointer work. Some bits were left when importing. Modified Files: SGSharedPtr.hxx SGWeakPtr.hxx --- simgear/structure/SGSharedPtr.hxx | 2 ++ simgear/structure/SGWeakPtr.hxx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/simgear/structure/SGSharedPtr.hxx b/simgear/structure/SGSharedPtr.hxx index b99a6a8f..a494937b 100644 --- a/simgear/structure/SGSharedPtr.hxx +++ b/simgear/structure/SGSharedPtr.hxx @@ -98,6 +98,8 @@ public: private: void assign(T* p) { get(p); put(); _ptr = p; } + void assignNonRef(T* p) + { put(); _ptr = p; } void get(const T* p) const { T::get(p); } diff --git a/simgear/structure/SGWeakPtr.hxx b/simgear/structure/SGWeakPtr.hxx index c84ae371..78cfab4a 100644 --- a/simgear/structure/SGWeakPtr.hxx +++ b/simgear/structure/SGWeakPtr.hxx @@ -27,6 +27,8 @@ public: { } SGWeakPtr(const SGWeakPtr& p) : mWeakData(p.mWeakData) { } + SGWeakPtr(T* ptr) + { assign(ptr); } template SGWeakPtr(const SGSharedPtr& p) { SGSharedPtr sharedPtr = p; assign(sharedPtr.get()); } -- 2.39.5