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:
Stefan Csomor
2001-08-29 07:25:39 +00:00
parent 135ace6d7b
commit fb606749b3
2 changed files with 26 additions and 16 deletions

View File

@@ -84,7 +84,7 @@ extern pascal void OTDebugStr(const char* str);
#include <OTDebug.h>
#endif
InetSvcRef gInetSvcRef = 0 ;
int gOTInited = 0 ;
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
@@ -211,6 +211,7 @@ int GSocket_Verify_Inited()
return TRUE ;
InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext);
gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath,
NULL, &err, clientcontext);
#else
@@ -218,6 +219,7 @@ int GSocket_Verify_Inited()
return TRUE ;
InitOpenTransport() ;
gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
#endif
if ( gInetSvcRef == NULL || err != kOTNoError )
@@ -230,13 +232,16 @@ int GSocket_Verify_Inited()
void GSocket_Cleanup()
{
if ( gInetSvcRef != NULL )
OTCloseProvider( gInetSvcRef );
#if TARGET_CARBON
CloseOpenTransportInContext( NULL ) ;
#else
CloseOpenTransport() ;
#endif
if ( gOTInited != 0 )
{
if ( gInetSvcRef != NULL )
OTCloseProvider( gInetSvcRef );
#if TARGET_CARBON
CloseOpenTransportInContext( NULL ) ;
#else
CloseOpenTransport() ;
#endif
}
}
/* Constructors / Destructors for GSocket */

View File

@@ -84,7 +84,7 @@ extern pascal void OTDebugStr(const char* str);
#include <OTDebug.h>
#endif
InetSvcRef gInetSvcRef = 0 ;
int gOTInited = 0 ;
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
@@ -211,6 +211,7 @@ int GSocket_Verify_Inited()
return TRUE ;
InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext);
gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath,
NULL, &err, clientcontext);
#else
@@ -218,6 +219,7 @@ int GSocket_Verify_Inited()
return TRUE ;
InitOpenTransport() ;
gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
#endif
if ( gInetSvcRef == NULL || err != kOTNoError )
@@ -230,13 +232,16 @@ int GSocket_Verify_Inited()
void GSocket_Cleanup()
{
if ( gInetSvcRef != NULL )
OTCloseProvider( gInetSvcRef );
#if TARGET_CARBON
CloseOpenTransportInContext( NULL ) ;
#else
CloseOpenTransport() ;
#endif
if ( gOTInited != 0 )
{
if ( gInetSvcRef != NULL )
OTCloseProvider( gInetSvcRef );
#if TARGET_CARBON
CloseOpenTransportInContext( NULL ) ;
#else
CloseOpenTransport() ;
#endif
}
}
/* Constructors / Destructors for GSocket */