corrected shutdown proc
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -84,7 +84,7 @@ extern pascal void OTDebugStr(const char* str);
|
|||||||
#include <OTDebug.h>
|
#include <OTDebug.h>
|
||||||
#endif
|
#endif
|
||||||
InetSvcRef gInetSvcRef = 0 ;
|
InetSvcRef gInetSvcRef = 0 ;
|
||||||
|
int gOTInited = 0 ;
|
||||||
|
|
||||||
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
|
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
|
||||||
|
|
||||||
@@ -211,6 +211,7 @@ int GSocket_Verify_Inited()
|
|||||||
return TRUE ;
|
return TRUE ;
|
||||||
|
|
||||||
InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext);
|
InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext);
|
||||||
|
gOTInited = 1 ;
|
||||||
gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath,
|
gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath,
|
||||||
NULL, &err, clientcontext);
|
NULL, &err, clientcontext);
|
||||||
#else
|
#else
|
||||||
@@ -218,6 +219,7 @@ int GSocket_Verify_Inited()
|
|||||||
return TRUE ;
|
return TRUE ;
|
||||||
|
|
||||||
InitOpenTransport() ;
|
InitOpenTransport() ;
|
||||||
|
gOTInited = 1 ;
|
||||||
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
|
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
|
||||||
#endif
|
#endif
|
||||||
if ( gInetSvcRef == NULL || err != kOTNoError )
|
if ( gInetSvcRef == NULL || err != kOTNoError )
|
||||||
@@ -230,13 +232,16 @@ int GSocket_Verify_Inited()
|
|||||||
|
|
||||||
void GSocket_Cleanup()
|
void GSocket_Cleanup()
|
||||||
{
|
{
|
||||||
|
if ( gOTInited != 0 )
|
||||||
|
{
|
||||||
if ( gInetSvcRef != NULL )
|
if ( gInetSvcRef != NULL )
|
||||||
OTCloseProvider( gInetSvcRef );
|
OTCloseProvider( gInetSvcRef );
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
CloseOpenTransportInContext( NULL ) ;
|
CloseOpenTransportInContext( NULL ) ;
|
||||||
#else
|
#else
|
||||||
CloseOpenTransport() ;
|
CloseOpenTransport() ;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Constructors / Destructors for GSocket */
|
/* Constructors / Destructors for GSocket */
|
||||||
|
@@ -84,7 +84,7 @@ extern pascal void OTDebugStr(const char* str);
|
|||||||
#include <OTDebug.h>
|
#include <OTDebug.h>
|
||||||
#endif
|
#endif
|
||||||
InetSvcRef gInetSvcRef = 0 ;
|
InetSvcRef gInetSvcRef = 0 ;
|
||||||
|
int gOTInited = 0 ;
|
||||||
|
|
||||||
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
|
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
|
||||||
|
|
||||||
@@ -211,6 +211,7 @@ int GSocket_Verify_Inited()
|
|||||||
return TRUE ;
|
return TRUE ;
|
||||||
|
|
||||||
InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext);
|
InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext);
|
||||||
|
gOTInited = 1 ;
|
||||||
gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath,
|
gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath,
|
||||||
NULL, &err, clientcontext);
|
NULL, &err, clientcontext);
|
||||||
#else
|
#else
|
||||||
@@ -218,6 +219,7 @@ int GSocket_Verify_Inited()
|
|||||||
return TRUE ;
|
return TRUE ;
|
||||||
|
|
||||||
InitOpenTransport() ;
|
InitOpenTransport() ;
|
||||||
|
gOTInited = 1 ;
|
||||||
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
|
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
|
||||||
#endif
|
#endif
|
||||||
if ( gInetSvcRef == NULL || err != kOTNoError )
|
if ( gInetSvcRef == NULL || err != kOTNoError )
|
||||||
@@ -230,13 +232,16 @@ int GSocket_Verify_Inited()
|
|||||||
|
|
||||||
void GSocket_Cleanup()
|
void GSocket_Cleanup()
|
||||||
{
|
{
|
||||||
|
if ( gOTInited != 0 )
|
||||||
|
{
|
||||||
if ( gInetSvcRef != NULL )
|
if ( gInetSvcRef != NULL )
|
||||||
OTCloseProvider( gInetSvcRef );
|
OTCloseProvider( gInetSvcRef );
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
CloseOpenTransportInContext( NULL ) ;
|
CloseOpenTransportInContext( NULL ) ;
|
||||||
#else
|
#else
|
||||||
CloseOpenTransport() ;
|
CloseOpenTransport() ;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Constructors / Destructors for GSocket */
|
/* Constructors / Destructors for GSocket */
|
||||||
|
Reference in New Issue
Block a user