]> git.cworth.org Git - apitrace/commitdiff
Handle spurious calls from wglCreateContextAttribsARB to wglCreateContext (issue...
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 5 Oct 2012 16:21:46 +0000 (17:21 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 5 Oct 2012 16:22:17 +0000 (17:22 +0100)
wrappers/gltrace_state.cpp

index cb8e08b1accce6b7818a55528f74809f7da1cd53..023d09e3e32d5bcd859a199349caf488ffe9249c 100644 (file)
@@ -115,12 +115,17 @@ bool releaseContext(uintptr_t context_id)
 
 void createContext(uintptr_t context_id)
 {
+    // wglCreateContextAttribsARB causes internal calls to wglCreateContext to be
+    // traced, causing context to be defined twice.
+    if (context_map.find(context_id) != context_map.end()) {
+        return;
+    }
+
     context_ptr_t ctx(new Context);
 
     context_map_mutex.lock();
 
     _retainContext(ctx);
-    assert(context_map.find(context_id) == context_map.end());
     context_map[context_id] = ctx;
 
     context_map_mutex.unlock();