]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace_egl.cpp
Merge branch 'master' into mt-trace
[apitrace] / retrace / glretrace_egl.cpp
index 79b16217b5b51f81bca0ce0f8a799bae02d0c07d..45855643f5b55272e494be1bcef8a799e26c928f 100644 (file)
@@ -203,7 +203,11 @@ static void retrace_eglDestroyContext(trace::Call &call) {
     it = context_map.find(orig_context);
 
     if (it != context_map.end()) {
-        delete it->second;
+        glretrace::Context *currentContext = glretrace::getCurrentContext();
+        if (it->second != currentContext) {
+            // TODO: reference count
+            delete it->second;
+        }
         context_map.erase(it);
     }
 }