Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class NewGutenbergViewController: UIViewController, PostEditor, PublishingEditor
private var hasEditorStarted = false
private var isModalDialogOpen = false

lazy var autosaver = Autosaver() {
self.performAutoSave()
lazy var autosaver = Autosaver() { [weak self] in
self?.performAutoSave()
}

// MARK: - Private Properties
Expand Down Expand Up @@ -197,6 +197,9 @@ class NewGutenbergViewController: UIViewController, PostEditor, PublishingEditor

deinit {
tearDownKeyboardObservers()

// Cancel any pending tasks
editorLoadingTask?.cancel()
}

// MARK: - Lifecycle methods
Expand Down Expand Up @@ -247,7 +250,8 @@ class NewGutenbergViewController: UIViewController, PostEditor, PublishingEditor
preconditionFailure("Dependency loading should not be cancelled")
}

self.editorLoadingTask = Task {
self.editorLoadingTask = Task { [weak self] in
guard let self else { return }
do {
while case .loadingDependencies = self.editorState {
try await Task.sleep(nanoseconds: 1000)
Expand Down