diff -r 4ba73111e824 -r 82d8da1d79c7 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 {