Skip to content

Commit 35a0f0c

Browse files
committed
fix: Editor loading allows deinit with weak self references
Allow clean up while the editor closes.
1 parent e8bb7fd commit 35a0f0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WordPress/Classes/ViewRelated/NewGutenberg/NewGutenbergViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ class NewGutenbergViewController: UIViewController, PostEditor, PublishingEditor
250250
preconditionFailure("Dependency loading should not be cancelled")
251251
}
252252

253-
self.editorLoadingTask = Task {
253+
self.editorLoadingTask = Task { [weak self] in
254+
guard let self else { return }
254255
do {
255256
while case .loadingDependencies = self.editorState {
256257
try await Task.sleep(nanoseconds: 1000)

0 commit comments

Comments
 (0)