void KprNetworkInterfaceCleanup()
{
#if TARGET_OS_IPHONE
	if (gNetworkInterfaceReachability) {
		SCNetworkReachabilityUnscheduleFromRunLoop(gNetworkInterfaceReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
		CFRelease(gNetworkInterfaceReachability);
	}
#elif TARGET_OS_MAC
	if (gNetworkInterfaceSource) {
		CFRelease(gNetworkInterfaceSource);
		gNetworkInterfaceSource = NULL;
	}
	if (gNetworkInterfaceStore) {
		CFRelease(gNetworkInterfaceStore);
		gNetworkInterfaceStore = NULL;
	}
#elif TARGET_OS_WIN32
	if (gNetworkInterfaceHandle) {
		CancelMibChangeNotify2(gNetworkInterfaceHandle);
		gNetworkInterfaceHandle = 0;
	}
#elif TARGET_OS_KPL
	#ifdef KPR_CONFIG
	KplNetInterfaceTerminate();
	#endif
#endif
}
Example #2
0
static void removeIOSNetworkInterfaceChangeTracker()
{
	if (reachability != nil) {
		(void)SCNetworkReachabilityUnscheduleFromRunLoop(reachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
		CFRelease(reachability);
		reachability = nil;
	}
}
Example #3
0
void SCNetworkEventPublisher::stop() {
  if (run_loop_ == nullptr) {
    // No need to stop if there is not run loop.
    return;
  }

  for (const auto& target : targets_) {
    SCNetworkReachabilityUnscheduleFromRunLoop(
        target, run_loop_, kCFRunLoopDefaultMode);
  }

  CFRunLoopStop(run_loop_);
}
Example #4
0
static void
ptr_query_stop()
{
	if (ptrTarget == NULL) {
		return;
	}

	my_log(LOG_INFO, "NetBIOS name: ptr query stop");

	SCNetworkReachabilitySetCallback(ptrTarget, NULL, NULL);
	SCNetworkReachabilityUnscheduleFromRunLoop(ptrTarget, rl, kCFRunLoopDefaultMode);
	CFRelease(ptrTarget);
	ptrTarget = NULL;

	return;
}