]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace_egl.cpp
glstate: Bind the bound draw fbo for read before dumping.
[apitrace] / retrace / glretrace_egl.cpp
index 79b16217b5b51f81bca0ce0f8a799bae02d0c07d..42f7b3867a783756d93cdb7d1a26724764bf7d51 100644 (file)
@@ -188,7 +188,7 @@ static void retrace_eglCreateContext(trace::Call &call) {
         }
 
         retrace::warning(call) << "Failed to create " << name << " context.\n";
-        os::abort();
+        exit(1);
     }
 
     context_map[orig_context] = context;
@@ -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);
     }
 }