 
     deinit {
         NotificationCenter.default.removeObserver(self)
+        #if os(iOS)
+            if let reachability = reachability {
+                if !SCNetworkReachabilitySetCallback(reachability, nil, nil) {
+                    Logger.error(message: "\(self) error unsetting reachability callback")
+                }
+                if !SCNetworkReachabilitySetDispatchQueue(reachability, nil) {
+                    Logger.error(message: "\(self) error unsetting reachability dispatch queue")
+                }
+            }
+        #endif
     }
 
     static func isiOSAppExtension() -> Bool {

        let label = "com.mixpanel.\(self.apiToken)"
        trackingQueue = DispatchQueue(label: label)
        networkQueue = DispatchQueue(label: label)
        flushInstance.delegate = self
        distinctId = defaultDistinctId()
        people = People(apiToken: self.apiToken,

#else
import Cocoa
#endif // os(OSX)
#if os(iOS)
import SystemConfiguration
#endif

/**
 *  Delegate protocol for controlling the Mixpanel API's network behavior.
