From 68e4806788a2e2001a34cfe2e6f91f37de7cc75e Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 21 Oct 2021 15:50:18 +0200 Subject: [PATCH] Gui: [skip ci] add get() method to WeakPtrT class --- src/Gui/DocumentObserver.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Gui/DocumentObserver.h b/src/Gui/DocumentObserver.h index 6608fa9df7..63a20df9b4 100644 --- a/src/Gui/DocumentObserver.h +++ b/src/Gui/DocumentObserver.h @@ -274,6 +274,11 @@ public: bool operator!= (const WeakPtrT& p) const { return ptr != p.ptr; } + /*! Get a pointer to the object or 0 if it doesn't exist any more. */ + T* get() const noexcept + { + return ptr.get(); + } private: // disable