]> git.mxchange.org Git - simgear.git/commitdiff
Make the weak pointer work. Some bits were left when importing.
authorfrohlich <frohlich>
Wed, 16 Sep 2009 05:04:05 +0000 (05:04 +0000)
committerTim Moore <timoore@redhat.com>
Thu, 17 Sep 2009 10:18:07 +0000 (12:18 +0200)
Modified Files:
SGSharedPtr.hxx SGWeakPtr.hxx

simgear/structure/SGSharedPtr.hxx
simgear/structure/SGWeakPtr.hxx

index b99a6a8f7f95bd64f993de5be65be825e0e1ba50..a494937bbaa11aef1b5dc3d41adcb43723da7db3 100644 (file)
@@ -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); }
index c84ae371d59d5b2123908d00bcf2124b0ca018e5..78cfab4a2507d765d3af9329dc9042ac7eb6fa31 100644 (file)
@@ -27,6 +27,8 @@ public:
   { }
   SGWeakPtr(const SGWeakPtr& p) : mWeakData(p.mWeakData)
   { }
+  SGWeakPtr(T* ptr)
+  { assign(ptr); }
   template<typename U>
   SGWeakPtr(const SGSharedPtr<U>& p)
   { SGSharedPtr<T> sharedPtr = p; assign(sharedPtr.get()); }