mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add ScopedPointer::reset
This commit is contained in:
@@ -185,6 +185,15 @@ public:
|
||||
*/
|
||||
ObjectType* release() { ObjectType* const o = object; object = nullptr; return o; }
|
||||
|
||||
void reset (ObjectType* object_)
|
||||
{
|
||||
if (object != object_)
|
||||
{
|
||||
ContainerDeletePolicy <ObjectType>::destroy (object);
|
||||
object = object_;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
/** Swaps this object with that of another ScopedPointer.
|
||||
The two objects simply exchange their pointers.
|
||||
|
||||
Reference in New Issue
Block a user