aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/shared/emugl/common/smart_ptr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'emulator/opengl/shared/emugl/common/smart_ptr.cpp')
-rw-r--r--emulator/opengl/shared/emugl/common/smart_ptr.cpp4
1 files changed, 3 insertions, 1 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;