mirror of
https://github.com/qvacua/vimr.git
synced 2024-09-11 17:15:34 +03:00
Fix memory leak
This commit is contained in:
parent
26028751d7
commit
c4e4c9b688
@ -24,9 +24,9 @@ class Document: NSDocument, NSWindowDelegate {
|
||||
self.nvimView
|
||||
.events
|
||||
.observe(on: MainScheduler.instance)
|
||||
.subscribe(onNext: { event in
|
||||
.subscribe(onNext: { [weak self] event in
|
||||
switch event {
|
||||
case .neoVimStopped: self.close()
|
||||
case .neoVimStopped: self?.close()
|
||||
default: break
|
||||
}
|
||||
})
|
||||
|
@ -70,8 +70,11 @@ extension MainWindow {
|
||||
func bufferListChanged() {
|
||||
self.neoVimView
|
||||
.allBuffers()
|
||||
.subscribe(onSuccess: { buffers in
|
||||
self.emit(self.uuidAction(for: .setBufferList(buffers.filter(\.isListed))))
|
||||
.subscribe(onSuccess: { [weak self] buffers in
|
||||
guard let action = self?.uuidAction(for: .setBufferList(buffers.filter(\.isListed))) else {
|
||||
return
|
||||
}
|
||||
self?.emit(action)
|
||||
})
|
||||
.disposed(by: self.disposeBag)
|
||||
}
|
||||
@ -87,8 +90,8 @@ extension MainWindow {
|
||||
func tabChanged() {
|
||||
self.neoVimView
|
||||
.currentBuffer()
|
||||
.subscribe(onSuccess: {
|
||||
self.newCurrentBuffer($0)
|
||||
.subscribe(onSuccess: { [weak self] in
|
||||
self?.newCurrentBuffer($0)
|
||||
})
|
||||
.disposed(by: self.disposeBag)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user