mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-29 00:34:26 +03:00
Do not unown self in subscribe of the main window state source
- we explicitly terminate the sequence when we close the window
This commit is contained in:
parent
0b47107188
commit
494f3625d1
@ -51,7 +51,7 @@ class FileBrowser: NSView,
|
||||
|
||||
source
|
||||
.observeOn(MainScheduler.instance)
|
||||
.subscribe(onNext: { [unowned self] state in
|
||||
.subscribe(onNext: { state in
|
||||
if self.cwd != state.cwd {
|
||||
self.cwd = state.cwd
|
||||
self.innerCustomToolbar.goToParentButton.isEnabled = state.cwd.path != "/"
|
||||
|
@ -46,7 +46,7 @@ class FileOutlineView: NSOutlineView,
|
||||
latest: true,
|
||||
scheduler: SerialDispatchQueueScheduler(qos: .background))
|
||||
.observeOn(MainScheduler.instance)
|
||||
.subscribe(onNext: { [unowned self] state in
|
||||
.subscribe(onNext: { state in
|
||||
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
|
||||
self.update(state.lastFileSystemUpdate.payload)
|
||||
})
|
||||
@ -54,7 +54,7 @@ class FileOutlineView: NSOutlineView,
|
||||
|
||||
source
|
||||
.observeOn(MainScheduler.instance)
|
||||
.subscribe(onNext: { [unowned self] state in
|
||||
.subscribe(onNext: { state in
|
||||
if state.viewToBeFocused != nil, case .fileBrowser = state.viewToBeFocused! {
|
||||
self.beFirstResponder()
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ class MainWindow: NSObject,
|
||||
source
|
||||
.observeOn(MainScheduler.instance)
|
||||
.subscribe(
|
||||
onNext: { [unowned self] state in
|
||||
onNext: { state in
|
||||
if self.isClosing {
|
||||
return
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ class PreviewTool: NSView, UiComponent, WKNavigationDelegate {
|
||||
|
||||
source
|
||||
.observeOn(MainScheduler.instance)
|
||||
.subscribe(onNext: { [unowned self] state in
|
||||
.subscribe(onNext: { state in
|
||||
if state.viewToBeFocused != nil, case .preview = state.viewToBeFocused! {
|
||||
self.beFirstResponder()
|
||||
}
|
||||
@ -107,7 +107,7 @@ class PreviewTool: NSView, UiComponent, WKNavigationDelegate {
|
||||
|
||||
self.lastUpdateDate = state.preview.updateDate
|
||||
self.webview.load(URLRequest(url: serverUrl))
|
||||
}, onCompleted: { [unowned self] in
|
||||
}, onCompleted: {
|
||||
// We have to do the following to avoid a crash... Dunno why... -_-
|
||||
self.webviewMessageHandler.subject.onCompleted()
|
||||
self.webview.navigationDelegate = nil
|
||||
|
Loading…
Reference in New Issue
Block a user