- 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
+ if ( gOTNotifierUPP )
+ DisposeOTNotifyUPP( gOTNotifierUPP ) ;
+ }