Fix crash going from connected to standalone game: don't invoke sockrw

code when its "self" is null.
This commit is contained in:
ehouse 2009-09-20 22:23:56 +00:00
parent 5fa3e2209c
commit 63fc1e048a
2 changed files with 8 additions and 2 deletions

View file

@ -2716,11 +2716,16 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
#ifndef XWFEATURE_STANDALONE_ONLY #ifndef XWFEATURE_STANDALONE_ONLY
case XWWM_HOSTNAME_ARRIVED: case XWWM_HOSTNAME_ARRIVED:
ce_sockwrap_hostname( globals->socketWrap, wParam, lParam ); /* drop it if we're standalone now */
if ( !!globals->socketWrap ) {
ce_sockwrap_hostname( globals->socketWrap, wParam, lParam );
}
break; break;
case XWWM_SOCKET_EVT: case XWWM_SOCKET_EVT:
draw = ce_sockwrap_event( globals->socketWrap, wParam, lParam ); if ( !!globals->socketWrap ) {
draw = ce_sockwrap_event( globals->socketWrap, wParam, lParam );
}
break; break;
#endif #endif

View file

@ -307,6 +307,7 @@ ce_sockwrap_hostname( CeSocketWrapper* self, WPARAM XP_UNUSED_DBG(wParam),
LPARAM lParam ) LPARAM lParam )
{ {
LOG_FUNC(); LOG_FUNC();
XP_ASSERT( !!self );
DWORD err = WSAGETASYNCERROR( lParam ); DWORD err = WSAGETASYNCERROR( lParam );
XP_ASSERT( CE_IPST_RESOLVINGHOST == self->connState ); XP_ASSERT( CE_IPST_RESOLVINGHOST == self->connState );