diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-01-20 12:00:59 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-01-20 12:03:57 +0100 |
commit | 229891d6cbc24f9e6291d8057d0d51326b059d9b (patch) | |
tree | a2280d2fcf5a2d47a924ec98ede86286d48aca8e | |
parent | 145ad1964389d363e389490be4b9acad1b6b7b99 (diff) |
lets do that before we delete our object
Change-Id: I8c7166ba66f74f5c548bb6fb30dfc3d28880e9a2
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index d2372494f970..5df70f44a234 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -114,13 +114,14 @@ void OpenGLContext::AddRef(SalGraphicsImpl* 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); + + assert(mnRefCount > 0); + if( --mnRefCount == 0 ) + delete this; } #else void OpenGLContext::AddRef() |