git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50893
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Added wxWindow::GetNextSibling() and GetPrevSibling()
- Added wxWindow::GetNextSibling() and GetPrevSibling()
+wxMSW:
+
+- Fix rare bug with messages delivered to wrong wxSocket (Tim Kosse)
+
/* Remove the socket from the list */
EnterCriticalSection(&critical);
if ( socket->IsOk() )
/* Remove the socket from the list */
EnterCriticalSection(&critical);
if ( socket->IsOk() )
- socketList[(socket->m_msgnumber - WM_USER)] = NULL;
+ {
+ const int msgnum = socket->m_msgnumber;
+
+ // we need to remove any pending messages for this socket to avoid having
+ // them sent to a new socket which could reuse the same message number as
+ // soon as we destroy this one
+ MSG msg;
+ while ( ::PeekMessage(&msg, hWin, msgnum, msgnum, PM_REMOVE) )
+ ;
+
+ socketList[msgnum - WM_USER] = NULL;
+ }
+
LeaveCriticalSection(&critical);
}
LeaveCriticalSection(&critical);
}