1
0
Fork 0

Fix tiny memory leak, as reported by Valgrind.

This commit is contained in:
durk 2007-10-02 16:14:16 +00:00
parent 8b7c493d41
commit ba3f716c86

View file

@ -163,6 +163,7 @@ FGMultiplayMgr::sIdPropertyList[] = {
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
FGMultiplayMgr::FGMultiplayMgr() FGMultiplayMgr::FGMultiplayMgr()
{ {
mSocket = 0;
mInitialised = false; mInitialised = false;
mHaveServer = false; mHaveServer = false;
} // FGMultiplayMgr::FGMultiplayMgr() } // FGMultiplayMgr::FGMultiplayMgr()
@ -218,6 +219,8 @@ FGMultiplayMgr::init (void)
SG_LOG(SG_NETWORK,SG_INFO,"FGMultiplayMgr::init-rxaddress="<<rxAddress ); SG_LOG(SG_NETWORK,SG_INFO,"FGMultiplayMgr::init-rxaddress="<<rxAddress );
SG_LOG(SG_NETWORK,SG_INFO,"FGMultiplayMgr::init-rxport= "<<rxPort); SG_LOG(SG_NETWORK,SG_INFO,"FGMultiplayMgr::init-rxport= "<<rxPort);
SG_LOG(SG_NETWORK,SG_INFO,"FGMultiplayMgr::init-callsign= "<<mCallsign); SG_LOG(SG_NETWORK,SG_INFO,"FGMultiplayMgr::init-callsign= "<<mCallsign);
Close(); // Should Init be called twice, close Socket first
// A memory leak was reported here by valgrind
mSocket = new netSocket(); mSocket = new netSocket();
if (!mSocket->open(false)) { if (!mSocket->open(false)) {
SG_LOG( SG_NETWORK, SG_ALERT, SG_LOG( SG_NETWORK, SG_ALERT,