Skip to content

Commit

Permalink
Fix possible retain cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed Jan 22, 2025
1 parent 7e736a0 commit 0d958d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Ice/UI/IceBar/IceBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ final class IceBarPanel: NSPanel {
.store(in: &c)

if
let appState,
let section = appState.menuBarManager.section(withName: .hidden),
let section = appState?.menuBarManager.section(withName: .hidden),
let window = section.controlItem.window
{
window.publisher(for: \.frame)
.debounce(for: 0.1, scheduler: DispatchQueue.main)
.sink { [weak self, weak window] _ in
guard
let self,
let appState,
// Only continue if the menu bar is automatically hidden, as Ice
// can't currently display its menu bar items.
appState.menuBarManager.isMenuBarHiddenBySystemUserDefaults,
Expand Down

0 comments on commit 0d958d6

Please sign in to comment.