diff options
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/opengl/shared/emugl/common/smart_ptr.cpp | 4 | ||||
-rw-r--r-- | emulator/opengl/shared/emugl/common/smart_ptr.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/emulator/opengl/shared/emugl/common/smart_ptr.cpp b/emulator/opengl/shared/emugl/common/smart_ptr.cpp index 9ac7339..703487d 100644 --- a/emulator/opengl/shared/emugl/common/smart_ptr.cpp +++ b/emulator/opengl/shared/emugl/common/smart_ptr.cpp @@ -101,8 +101,10 @@ void* SmartPtrBase::release() { mPtr = NULL; mRefCount = NULL; - if (old_refcount->decrement()) + if (old_refcount->decrement()) { + delete old_refcount; return old_ptr; + } } return NULL; diff --git a/emulator/opengl/shared/emugl/common/smart_ptr.h b/emulator/opengl/shared/emugl/common/smart_ptr.h index 2d7db5b..73efdd6 100644 --- a/emulator/opengl/shared/emugl/common/smart_ptr.h +++ b/emulator/opengl/shared/emugl/common/smart_ptr.h @@ -39,7 +39,7 @@ public: // Assignment operator, also increments the reference count. SmartPtrBase& operator=(const SmartPtrBase& other); - // Nothing happens in this constructor, the real work must be performed + // Nothing happens in this destructor, the real work must be performed // in subclasses. ~SmartPtrBase() {} |