]> git.saurik.com Git - wxWidgets.git/commitdiff
don't crash when destroying a not initialized socket (patch 1489095)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 28 May 2006 23:38:11 +0000 (23:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 28 May 2006 23:38:11 +0000 (23:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/gsockmsw.cpp

index 7be69eb826dd0ab4190c4bd46b5b84c308a9b02a..12ae969e4ccfa42b9f30acfb3c4cb9de5add9bf1 100644 (file)
@@ -335,7 +335,8 @@ void GSocketGUIFunctionsTableConcrete::Destroy_Socket(GSocket *socket)
 {
   /* Remove the socket from the list */
   EnterCriticalSection(&critical);
-  socketList[(socket->m_msgnumber - WM_USER)] = NULL;
+  if ( socket->IsOk() )
+      socketList[(socket->m_msgnumber - WM_USER)] = NULL;
   LeaveCriticalSection(&critical);
 }