diff --git a/src/beast/beast/smart_ptr/ScopedPointer.h b/src/beast/beast/smart_ptr/ScopedPointer.h index 5e16c6451..3e1cf791b 100644 --- a/src/beast/beast/smart_ptr/ScopedPointer.h +++ b/src/beast/beast/smart_ptr/ScopedPointer.h @@ -185,6 +185,15 @@ public: */ ObjectType* release() { ObjectType* const o = object; object = nullptr; return o; } + void reset (ObjectType* object_) + { + if (object != object_) + { + ContainerDeletePolicy ::destroy (object); + object = object_; + } + } + //============================================================================== /** Swaps this object with that of another ScopedPointer. The two objects simply exchange their pointers.