From ea9f80399b4b0468b1c91acda3b5087b042e1673 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Thu, 18 Sep 2008 11:15:15 -0700 Subject: fix crash when trying to set the title on a window that's already closed --- ChangeLog | 5 +++++ src/CurrentWindowCmd.cc | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 94da1ba..d08bfc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ (Format: Year/Month/Day) +Changes for 1.1.2 +*08/09/18: + * Fix crash when using SetTitleDialog on a window that's been closed (Mark) + CurrentWindowCmd.cc +----------------------------- Changes for 1.1.1 *08/09/14: * Fixed a minor pixmap resource leak (Henrik) diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index 59b0186..dfb5c19 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc @@ -467,13 +467,17 @@ void SetLayerCmd::real_execute() { } namespace { -class SetTitleDialog: public TextDialog { +class SetTitleDialog: public TextDialog, public FbTk::Observer { public: SetTitleDialog(FluxboxWindow &win, const string &title): TextDialog(win.screen(), title), window(win) { + win.dieSig().attach(this); setText(win.title()); } + // only attached signal is window destruction + void update(FbTk::Subject *subj) { delete this; } + private: void exec(const std::string &text) { window.winClient().setTitle(text); -- cgit v0.11.2