summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r--src/resources/image.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index d9d2a8a01..d6f5cd27c 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -467,3 +467,12 @@ void Image::SDLTerminateAlphaCache()
SDLCleanCache();
mUseAlphaCache = false;
}
+
+#ifdef USE_OPENGL
+void Image::decRef()
+{
+ if (getRefCount() <= 1)
+ OpenGLImageHelper::invalidate(mGLImage);
+ Resource::decRef();
+}
+#endif