diff --git a/distrho/extra/ScopedPointer.hpp b/distrho/extra/ScopedPointer.hpp index 6349199c..5e04fb13 100644 --- a/distrho/extra/ScopedPointer.hpp +++ b/distrho/extra/ScopedPointer.hpp @@ -172,6 +172,11 @@ public: /** Lets you access methods and properties of the object that this ScopedPointer refers to. */ ObjectType* operator->() const noexcept { return object; } + //============================================================================== + /** Removes the current object from this ScopedPointer and deletes it. + */ + void reset() noexcept { ObjectType* const o = object; object = nullptr; delete o; } + //============================================================================== /** Removes the current object from this ScopedPointer without deleting it. This will return the current object, and set the ScopedPointer to a null pointer.