Globals mustn't be MCAutoStringRef... They have to be MCStringRef. Such things should be initialized/finalized in an Initialize/Finalize pair (MCReachabilityInitialize / MCReachabilityFinalize). These init/finit methods should be called from X_clear_globals / X_close.