hostsupport/hostegl/src/eglapi.cpp
branchbug235_bringup_0
changeset 75 82d8da1d79c7
parent 67 ca7e6949bf7a
--- 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
         {