Skip to content

Commit b398194

Browse files
committed
fix unmaneged runLoopSource
1 parent 5f9abf4 commit b398194

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ios/Classes/SwiftFlutterSystemProxyPlugin.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class SwiftFlutterSystemProxyPlugin: NSObject, FlutterPlugin {
5151
}else if(pacUrl != nil){
5252
self.handlePacUrl(pacUrl: pacUrl!,url: url)
5353
}
54-
} else if (proxConfigDict![kCFNetworkProxiesHTTPEnable] as! Int == 1){
54+
} else if (proxConfigDict![kCFNetworkProxiesHTTPEnable] as? Int == 1){
5555
var dict: [String: Any] = [:]
5656
dict["host"] = proxConfigDict![kCFNetworkProxiesHTTPProxy] as? String
5757
dict["port"] = proxConfigDict![kCFNetworkProxiesHTTPPort] as? Int
@@ -101,7 +101,7 @@ public class SwiftFlutterSystemProxyPlugin: NSObject, FlutterPlugin {
101101
let runLoop = CFRunLoopGetCurrent();
102102
CFRunLoopAddSource(runLoop, getRunLoopSource(runLoopSource), CFRunLoopMode.defaultMode);
103103
CFRunLoopRun();
104-
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), runLoopSource, CFRunLoopMode.defaultMode);
104+
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), getRunLoopSource(runLoopSource), CFRunLoopMode.defaultMode);
105105
})
106106
}
107107

0 commit comments

Comments
 (0)