mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
WindowServer: Don't try to flash menubar in deleted windows
Capture the window weakly when setting up the menubar flash timer.
This commit is contained in:
parent
c53486b9ce
commit
611733af0d
1 changed files with 5 additions and 3 deletions
|
@ -216,9 +216,11 @@ void ClientConnection::flash_menubar_menu(i32 window_id, i32 menu_id)
|
|||
m_flashed_menu_timer->stop();
|
||||
}
|
||||
|
||||
m_flashed_menu_timer = Core::Timer::create_single_shot(75, [&window] {
|
||||
window.menubar().flash_menu(nullptr);
|
||||
window.frame().invalidate_menubar();
|
||||
m_flashed_menu_timer = Core::Timer::create_single_shot(75, [weak_window = window.make_weak_ptr<Window>()]() mutable {
|
||||
if (!weak_window)
|
||||
return;
|
||||
weak_window->menubar().flash_menu(nullptr);
|
||||
weak_window->frame().invalidate_menubar();
|
||||
});
|
||||
m_flashed_menu_timer->start();
|
||||
} else if (m_flashed_menu_timer) {
|
||||
|
|
Loading…
Add table
Reference in a new issue