Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

properly release editor when closed

PJ36c4def8e3ff
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index d8a1edea1..e98f39fc9 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -2407,9 +2407,9 @@ async fn create_editor_instance_impl(app: &AppHandle, video_id: String) -> Arc<E
.await;
RenderFrameEvent::listen_any(app, {
- let instance = instance.clone();
+ let preview_tx = instance.preview_tx.clone();
move |e| {
- instance.preview_tx.send(Some(e.payload.frame_number)).ok();
+ preview_tx.send(Some(e.payload.frame_number)).ok();
}
});
diff --git a/crates/editor/src/editor_instance.rs b/crates/editor/src/editor_instance.rs
index 9573dac53..65471124b 100644
--- a/crates/editor/src/editor_instance.rs
+++ b/crates/editor/src/editor_instance.rs
@@ -286,16 +286,15 @@ impl EditorInstance {
)
.await;
}
- // Does the editor instance here (self) get dropped??? I have no idea
- // The task gets cancelled, which should theoretically drop it
})
}
}
impl Drop for EditorInstance {
fn drop(&mut self) {
- // TODO: Ensure that *all* resources have been released by this point.
- println!("Editor instance {} has been released.", self.id);
+ // TODO: Ensure that *all* resources have been released by this point?
+ // For now the `dispose` method is adequate.
+ println!("*** Editor instance {} has been released. ***", self.id);
}
}