From f4ce81e8c926501d9b5b4af7d620902fe8da4a98 Mon Sep 17 00:00:00 2001 From: Chu Hoang Date: Thu, 15 Oct 2015 11:15:45 +0100 Subject: [PATCH] Added WeakHandleBase::Reset method. Change-Id: I8dc3606b7fb23b20897a33366520f9405bf5f9d5 --- dali/devel-api/object/weak-handle.cpp | 7 +++++++ dali/devel-api/object/weak-handle.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/dali/devel-api/object/weak-handle.cpp b/dali/devel-api/object/weak-handle.cpp index 94bb88f..eeed348 100644 --- a/dali/devel-api/object/weak-handle.cpp +++ b/dali/devel-api/object/weak-handle.cpp @@ -132,4 +132,11 @@ Handle WeakHandleBase::GetBaseHandle() const return Handle( mImpl->mObject ); } +void WeakHandleBase::Reset() +{ + delete mImpl; + mImpl = NULL; +} + + } // Dali diff --git a/dali/devel-api/object/weak-handle.h b/dali/devel-api/object/weak-handle.h index 81613f5..f2b4ea3 100644 --- a/dali/devel-api/object/weak-handle.h +++ b/dali/devel-api/object/weak-handle.h @@ -93,6 +93,12 @@ public: */ Handle GetBaseHandle() const; + /** + * @brief Resets this weak handle to not point to any Dali object + */ + void Reset(); + + protected: struct Impl; -- 2.7.4