1
1
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:
Tae Won Ha 2016-07-17 15:56:20 +02:00
parent 6a66cb877c
commit e51c823b17
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
3 changed files with 2 additions and 16 deletions

View File

@ -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];
}

View File

@ -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()
}

View File

@ -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)
}