mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-27 06:04:07 +03:00
GH-216 Get rid of almost all cleanUp() methods
- We cannot get rid of -cleanUp of NeoVimAgent since -dealloc does not get called unless the run loop has been stopped.
This commit is contained in:
parent
6a66cb877c
commit
e51c823b17
@ -63,11 +63,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
NSLog(@"dealloc of agent");
|
||||
}
|
||||
|
||||
// -dealloc would have been ideal for this, but if you quit the app, -dealloc does not necessarily get called...
|
||||
// We cannot use -dealloc for this since -dealloc is not called until the run loop in the thread stops.
|
||||
- (void)cleanUp {
|
||||
CFMessagePortInvalidate(_remoteServerPort);
|
||||
CFRelease(_remoteServerPort);
|
||||
@ -77,6 +73,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
|
||||
|
||||
CFRunLoopStop(_runLoop);
|
||||
[_localServerThread cancel];
|
||||
|
||||
[_neoVimServerTask interrupt];
|
||||
[_neoVimServerTask terminate];
|
||||
}
|
||||
|
@ -83,12 +83,6 @@ public class NeoVimView: NSView {
|
||||
}
|
||||
|
||||
deinit {
|
||||
NSLog("deinit of view")
|
||||
}
|
||||
|
||||
// deinit would have been ideal for this, but if you quit the app, deinit does not necessarily get called...
|
||||
public func cleanUp() {
|
||||
// NSLog("\(#function): clean up")
|
||||
self.agent.cleanUp()
|
||||
}
|
||||
|
||||
|
@ -15,10 +15,6 @@ class MainWindowController: NSWindowController, NSWindowDelegate, NeoVimViewDele
|
||||
private weak var mainWindowManager: MainWindowManager?
|
||||
|
||||
private let neoVimView = NeoVimView(forAutoLayout: ())
|
||||
|
||||
deinit {
|
||||
NSLog("deinit of window controller")
|
||||
}
|
||||
|
||||
func setup(manager manager: MainWindowManager) {
|
||||
self.mainWindowManager = manager
|
||||
@ -29,7 +25,6 @@ class MainWindowController: NSWindowController, NSWindowDelegate, NeoVimViewDele
|
||||
}
|
||||
|
||||
func windowWillClose(notification: NSNotification) {
|
||||
self.neoVimView.cleanUp()
|
||||
self.mainWindowManager?.closeMainWindow(self)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user