Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(desktop): release leaked NSGlassEffectView on re-apply

ManthanNimodiya22be2f798372
diff --git a/apps/desktop/src-tauri/src/platform/macos/mod.rs b/apps/desktop/src-tauri/src/platform/macos/mod.rs
index b5eb71e68..d940aab7e 100644
--- a/apps/desktop/src-tauri/src/platform/macos/mod.rs
+++ b/apps/desktop/src-tauri/src/platform/macos/mod.rs
@@ -98,6 +98,12 @@ unsafe fn remove_liquid_glass_subviews(
let is_glass_view: bool = msg_send![view, isKindOfClass: glass_class];
if is_glass_view {
let _: () = msg_send![view, removeFromSuperview];
+ // Balance the `alloc` ownership claim taken when this view was
+ // created in `apply_liquid_glass_background`. Without this,
+ // removing it from the hierarchy only drops the superview's
+ // retain, leaving it stuck at refcount 1 forever — a leaked
+ // GPU/IOSurface-backed NSGlassEffectView on every re-apply.
+ let _: () = msg_send![view, release];
continue;
}