mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
Move WSACleanup into main where it can be called once per launch
rather than per use of relay, parallel to WSAStartup.
This commit is contained in:
parent
f874183475
commit
f9e6c5631d
2 changed files with 5 additions and 4 deletions
|
@ -130,7 +130,7 @@ static const XP_UCHAR* ce_util_getUserString( XW_UtilCtxt* uc,
|
||||||
static XP_Bool ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
|
static XP_Bool ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
|
||||||
XP_U16 turn, XP_Bool turnLost );
|
XP_U16 turn, XP_Bool turnLost );
|
||||||
static void ce_util_remSelected( XW_UtilCtxt* uc );
|
static void ce_util_remSelected( XW_UtilCtxt* uc );
|
||||||
#if defined XWFEATURE_BLUETOOTH || defined XWFEATURE_RELAY
|
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||||
static void ce_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
|
static void ce_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
|
||||||
const CommsAddrRec* newAddr );
|
const CommsAddrRec* newAddr );
|
||||||
#endif
|
#endif
|
||||||
|
@ -1259,7 +1259,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow
|
||||||
wchar_t path[CE_MAX_PATH_LEN];
|
wchar_t path[CE_MAX_PATH_LEN];
|
||||||
MPSLOT;
|
MPSLOT;
|
||||||
|
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||||
{
|
{
|
||||||
WORD wVersionRequested;
|
WORD wVersionRequested;
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
|
@ -1889,10 +1889,13 @@ freeGlobals( CEAppGlobals* globals )
|
||||||
|
|
||||||
closeGame( globals );
|
closeGame( globals );
|
||||||
|
|
||||||
|
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||||
if ( !!globals->socketWrap ) {
|
if ( !!globals->socketWrap ) {
|
||||||
ce_sockwrap_delete( globals->socketWrap );
|
ce_sockwrap_delete( globals->socketWrap );
|
||||||
globals->socketWrap = NULL;
|
globals->socketWrap = NULL;
|
||||||
}
|
}
|
||||||
|
WSACleanup();
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( !!globals->vtMgr ) {
|
if ( !!globals->vtMgr ) {
|
||||||
vtmgr_destroy( MPPARM(mpool) globals->vtMgr );
|
vtmgr_destroy( MPPARM(mpool) globals->vtMgr );
|
||||||
|
|
|
@ -294,8 +294,6 @@ ce_sockwrap_delete( CeSocketWrapper* self )
|
||||||
some other way */
|
some other way */
|
||||||
closeConnection( self );
|
closeConnection( self );
|
||||||
|
|
||||||
WSACleanup();
|
|
||||||
|
|
||||||
XP_FREE( self->mpool, self );
|
XP_FREE( self->mpool, self );
|
||||||
} /* ce_sockwrap_delete */
|
} /* ce_sockwrap_delete */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue