diff --git a/apps/purepoint-macos/purepoint-macos/Views/CommandPalette/CommandPalettePanel.swift b/apps/purepoint-macos/purepoint-macos/Views/CommandPalette/CommandPalettePanel.swift index 881406b..341a3b1 100644 --- a/apps/purepoint-macos/purepoint-macos/Views/CommandPalette/CommandPalettePanel.swift +++ b/apps/purepoint-macos/purepoint-macos/Views/CommandPalette/CommandPalettePanel.swift @@ -81,12 +81,12 @@ class CommandPalettePanel: NSPanel { guard let vc = panel.contentViewController as? CommandPaletteViewController else { return panel } - vc.onSelect = { result in - panel.dismiss() + vc.onSelect = { [weak panel] result in + panel?.dismiss() onSelect(result) } - vc.onDismiss = { - panel.dismiss() + vc.onDismiss = { [weak panel] in + panel?.dismiss() } vc.setItems(items) panel.showRelativeTo(window: window)