summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-20 04:12:18 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-20 12:03:57 +0100
commit145ad1964389d363e389490be4b9acad1b6b7b99 (patch)
tree907fc0f38489d7202e7d0707f69a648b6cf699b9 /vcl/source/opengl
parent99f809c7eb0a2298f9c0044aeabdfc1bb72e2287 (diff)
some debug code for finding leaked OpenGLContexts
Change-Id: I10e8c344ae6aa2e0a4ef562154f57e2070c70e2f
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 32d2c28a2cd7..d2372494f970 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -103,6 +103,26 @@ OpenGLContext::~OpenGLContext()
pSVData->maGDIData.mpLastContext = mpPrevContext;
}
+#ifdef DBG_UTIL
+void OpenGLContext::AddRef(SalGraphicsImpl* pImpl)
+{
+ assert(mnRefCount > 0);
+ mnRefCount++;
+
+ maParents.insert(pImpl);
+}
+
+void OpenGLContext::DeRef(SalGraphicsImpl* pImpl)
+{
+ assert(mnRefCount > 0);
+ if( --mnRefCount == 0 )
+ delete this;
+
+ auto it = maParents.find(pImpl);
+ if(it != maParents.end())
+ maParents.erase(it);
+}
+#else
void OpenGLContext::AddRef()
{
assert(mnRefCount > 0);
@@ -115,6 +135,7 @@ void OpenGLContext::DeRef()
if( --mnRefCount == 0 )
delete this;
}
+#endif
void OpenGLContext::requestLegacyContext()
{