Move increment of EGL state reference count to where new threads bug235_bringup_0
authorMatt Plumtree <matt.plumtree@nokia.com>
Wed, 10 Nov 2010 15:26:31 +0000
branchbug235_bringup_0
changeset 75 82d8da1d79c7
parent 74 4ba73111e824
child 76 24381b61de5c
Move increment of EGL state reference count to where new threads are discovered for simulator version, to balance releaseState in eglReleaseThread.
hostsupport/hostegl/src/eglapi.cpp
--- a/hostsupport/hostegl/src/eglapi.cpp	Mon Nov 08 15:40:06 2010 +0000
+++ b/hostsupport/hostegl/src/eglapi.cpp	Wed Nov 10 15:26:31 2010 +0000
@@ -78,7 +78,6 @@
             g_eglState = NULL;
             return NULL;
             }
-        g_eglState->AddRef();
         }
     return g_eglState;
 #elif defined(_WIN32)
@@ -2493,11 +2492,13 @@
         EGLI_ASSERT( process != NULL );
         CEGLThread* thread = process->AddThread( threadId, true, state->SupportedApis() );
         EGLI_ASSERT( thread != NULL );
+        state->AddRef();
         }
     else if( !(process->HasThread( threadId )) )
         {
         CEGLThread* thread = process->AddThread( threadId, true, state->SupportedApis() );
         EGLI_ASSERT( thread != NULL );
+        state->AddRef();
         }
     else
         {