From: José Fonseca Date: Fri, 5 Oct 2012 16:21:46 +0000 (+0100) Subject: Handle spurious calls from wglCreateContextAttribsARB to wglCreateContext (issue... X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=beba02cddc397ada3f7b8e0fcf6ab09b24f46a49;p=apitrace Handle spurious calls from wglCreateContextAttribsARB to wglCreateContext (issue #95) --- diff --git a/wrappers/gltrace_state.cpp b/wrappers/gltrace_state.cpp index cb8e08b..023d09e 100644 --- a/wrappers/gltrace_state.cpp +++ b/wrappers/gltrace_state.cpp @@ -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();