]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace_egl.cpp
Don't destroy current EGL context.
[apitrace] / retrace / glretrace_egl.cpp
index 75688152f80419a8e2ffeb61b3ab2c654e7de865..10c950b038d4f398457162c3caa086fc17d728c9 100644 (file)
@@ -202,7 +202,10 @@ static void retrace_eglDestroyContext(trace::Call &call) {
     it = context_map.find(orig_context);
 
     if (it != context_map.end()) {
-        delete it->second;
+        if (it->second != currentContext) {
+            // TODO: reference count
+            delete it->second;
+        }
         context_map.erase(it);
     }
 }