From ed8a8d3c3718c4f97ea2c793f83a7190795cc2aa Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Thu, 30 Jun 2022 09:36:01 -0400 Subject: [PATCH 1/3] Don't process renderer output if there's no delegate. --- Classes/Rendering/Renderer.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/Rendering/Renderer.swift b/Classes/Rendering/Renderer.swift index 01b45b692..1a8ec119b 100644 --- a/Classes/Rendering/Renderer.swift +++ b/Classes/Rendering/Renderer.swift @@ -163,6 +163,8 @@ final class Renderer: Rendering { /// For this to work, all access to filteredPixelBuffer should be locked, so this method should be called in /// a synchronized(self) block. private func output(filteredPixelBuffer: CVPixelBuffer) { + guard let delegate = self.delegate else { return } + self.filteredPixelBuffer = filteredPixelBuffer callbackQueue.async { let pixelBuffer: CVPixelBuffer? = synchronized(self) { @@ -173,7 +175,7 @@ final class Renderer: Rendering { return pixelBuffer } if let filteredPixelBuffer = pixelBuffer { - self.delegate?.rendererReadyForDisplay(pixelBuffer: filteredPixelBuffer) + delegate.rendererReadyForDisplay(pixelBuffer: filteredPixelBuffer) } } } From dd7b104b25c6030a53af787eafdb3dfa89efb9c5 Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Thu, 30 Jun 2022 09:41:31 -0400 Subject: [PATCH 2/3] Bump spec version. --- Kanvas.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kanvas.podspec b/Kanvas.podspec index cf1ad616b..904ff71f4 100644 --- a/Kanvas.podspec +++ b/Kanvas.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |spec| spec.name = 'Kanvas' - spec.version = '1.4.2' + spec.version = '1.4.3' spec.summary = 'A custom camera built for iOS.' spec.homepage = 'https://github.com/tumblr/kanvas-ios' spec.license = 'MPLv2' From b699ec6210c903c86bd47bdf7c511711c42bf8dc Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Thu, 30 Jun 2022 10:23:18 -0400 Subject: [PATCH 3/3] Reload the current editor on export. --- .../Editor/MultiEditor/MultiEditorViewController.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Classes/Editor/MultiEditor/MultiEditorViewController.swift b/Classes/Editor/MultiEditor/MultiEditorViewController.swift index a6731b19b..57c0f6b0c 100644 --- a/Classes/Editor/MultiEditor/MultiEditorViewController.swift +++ b/Classes/Editor/MultiEditor/MultiEditorViewController.swift @@ -387,12 +387,14 @@ extension MultiEditorViewController: EditorControllerDelegate { editor.export { [weak self, editor] result in let _ = editor // strong reference until the export completes self?.exportHandler.handleExport(result, for: idx) - if let selected = self?.selected { - self?.loadEditor(for: selected, current: false) - } } } }) + + if let selected = self.selected { + loadEditor(for: selected, current: true) + } + return false }