fixed SIGSEGV when quitting due to deletion of UPnP handler during callback

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7634 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-10-25 12:48:03 +00:00
parent a3af37c7e4
commit 067e5d4fac
2 changed files with 6 additions and 2 deletions

View File

@ -1306,6 +1306,9 @@ int CUPnPControlPoint::Callback(Upnp_EventType EventType, void *Event, void * /*
// CUPnPControlPoint *upnpCP = static_cast<CUPnPControlPoint *>(Cookie);
CUPnPControlPoint *upnpCP = CUPnPControlPoint::s_CtrlPoint;
if(upnpCP == NULL)
return 0 ;
//fprintf(stderr, "Callback: %d, Cookie: %p\n", EventType, Cookie);
switch (EventType) {
case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:

View File

@ -232,6 +232,7 @@ bool upnphandler::shutdown_upnp()
//destroy the upnp object
cUPnPControlPoint->~CUPnPControlPoint();
cUPnPControlPoint=NULL ;
} else {
#ifdef UPNP_DEBUG
std::cerr << "upnphandler::shutdown_upnp() : avoid upnp connection for shutdonws because probably a net flag went down." << std::endl;