Index: BaseRefCounted.h
===================================================================
--- BaseRefCounted.h	(revision 11648)
+++ BaseRefCounted.h	(working copy)
@@ -28,6 +28,7 @@
     #define NS_BASEREFCOUNTED_OVERRIDABLE
 #endif
 
+template<class T> class Ptr;
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /// Base class for types that control their lifetime with a reference counter. Instances of this
@@ -65,6 +66,12 @@
     /// Gets current reference count for the object
     int32_t GetNumReferences() const;
 
+    /// Returns a handle for the object. Handles are weak references
+    uint32_t GetHandle();
+
+    /// Retrieves the object referenced by the handle or nullptr if it was already destroyed
+    static Ptr<BaseRefCounted> FromHandle(uint32_t handle);
+
 protected:
     /// Invoked when the reference counter reaches 0. By default the instance is deleted
     /// Can be reimplemented by child classes to avoid the default destruction
@@ -73,6 +80,7 @@
 
 private:
     AtomicInteger mRefCount;
+    uint32_t mHandle;
 
     NS_DECLARE_REFLECTION(BaseRefCounted, BaseObject)
 };
