From a53017cc3bad26906b99ac473513a10847c40bc0 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Tue, 15 Mar 2011 09:49:06 +0100 Subject: bugfix: do not use anything from the current ClientMenuItem after m_client.focus(), closes #3210493 m_client.focus() might call ~ClientMenuItem(), thus m_client is not available anymore. the crash was triggered by trying to deiconify a client via the clientmenu. this triggers a signal to remove and destroy the current ClientMenuItem. --- src/ClientMenu.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc index 6e1c442..063cad4 100644 --- a/src/ClientMenu.cc +++ b/src/ClientMenu.cc @@ -52,15 +52,17 @@ public: return; // this MenuItem object can get destroyed as a result of focus(), so we - // must get a local copy of the parent menu + // must get a local copy of anything we want to use here + // AFTER ~ClientMenuItem() is called. FbTk::Menu *parent = menu(); + FocusControl& focus_control = m_client.screen().focusControl(); m_client.focus(); fbwin->raise(); if ((mods & ControlMask) == 0) { // Ignore any focus changes due to this menu closing // (even in StrictMouseFocus mode) - m_client.screen().focusControl().ignoreAtPointer(true); + focus_control.ignoreAtPointer(true); parent->hide(); } } -- cgit v0.11.2