From beba02cddc397ada3f7b8e0fcf6ab09b24f46a49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 5 Oct 2012 17:21:46 +0100 Subject: [PATCH] Handle spurious calls from wglCreateContextAttribsARB to wglCreateContext (issue #95) --- wrappers/gltrace_state.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); -- 2.45.2