macos: clean up surface on close

This commit is contained in:
Mitchell Hashimoto
2023-02-18 15:21:44 -08:00
parent 7af516e7e6
commit 78754ff3ac

View File

@ -182,6 +182,11 @@ class TerminalSurfaceView_Real: NSView, NSTextInputClient, ObservableObject {
fatalError("init(coder:) is not supported for this view")
}
deinit {
guard let surface = self.surface else { return }
ghostty_surface_free(surface)
}
override func resize(withOldSuperviewSize oldSize: NSSize) {
super.resize(withOldSuperviewSize: oldSize)