File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
packages/desktop_multi_window/macos/Classes Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,25 @@ class FlutterWindow: BaseFlutterWindow {
79
79
window. titleVisibility = . hidden
80
80
window. titlebarAppearsTransparent = true
81
81
}
82
- }
83
82
84
- extension FlutterWindow : NSWindowDelegate {
85
- func windowWillClose ( _ notification : Notification ) {
83
+ deinit {
84
+ debugPrint ( " release window resource " )
86
85
window. delegate = nil
86
+ if let flutterViewController = window. contentViewController as? FlutterViewController {
87
+ flutterViewController. engine. shutDownEngine ( )
88
+ }
87
89
window. contentViewController = nil
88
90
window. windowController = nil
91
+ }
92
+ }
93
+
94
+ extension FlutterWindow : NSWindowDelegate {
95
+ func windowWillClose( _ notification: Notification ) {
96
+ delegate? . onClose ( windowId: windowId)
97
+ }
98
+
99
+ func windowShouldClose( _ sender: NSWindow ) -> Bool {
89
100
delegate? . onClose ( windowId: windowId)
101
+ return true
90
102
}
91
103
}
You can’t perform that action at this time.
0 commit comments