diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-09-18 18:15:15 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-09-18 18:15:15 (GMT) |
commit | ea9f80399b4b0468b1c91acda3b5087b042e1673 (patch) | |
tree | e65767b7077ad0f548ab78487b675b713b0e3a31 | |
parent | 8e97963e4211963f960c52c8a8f4bf5cd135ad2f (diff) | |
download | fluxbox-ea9f80399b4b0468b1c91acda3b5087b042e1673.zip fluxbox-ea9f80399b4b0468b1c91acda3b5087b042e1673.tar.bz2 |
fix crash when trying to set the title on a window that's already closed
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/CurrentWindowCmd.cc | 6 |
2 files changed, 10 insertions, 1 deletions
@@ -1,4 +1,9 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.1.2 | ||
3 | *08/09/18: | ||
4 | * Fix crash when using SetTitleDialog on a window that's been closed (Mark) | ||
5 | CurrentWindowCmd.cc | ||
6 | ----------------------------- | ||
2 | Changes for 1.1.1 | 7 | Changes for 1.1.1 |
3 | *08/09/14: | 8 | *08/09/14: |
4 | * Fixed a minor pixmap resource leak (Henrik) | 9 | * 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() { | |||
467 | } | 467 | } |
468 | 468 | ||
469 | namespace { | 469 | namespace { |
470 | class SetTitleDialog: public TextDialog { | 470 | class SetTitleDialog: public TextDialog, public FbTk::Observer { |
471 | public: | 471 | public: |
472 | SetTitleDialog(FluxboxWindow &win, const string &title): | 472 | SetTitleDialog(FluxboxWindow &win, const string &title): |
473 | TextDialog(win.screen(), title), window(win) { | 473 | TextDialog(win.screen(), title), window(win) { |
474 | win.dieSig().attach(this); | ||
474 | setText(win.title()); | 475 | setText(win.title()); |
475 | } | 476 | } |
476 | 477 | ||
478 | // only attached signal is window destruction | ||
479 | void update(FbTk::Subject *subj) { delete this; } | ||
480 | |||
477 | private: | 481 | private: |
478 | void exec(const std::string &text) { | 482 | void exec(const std::string &text) { |
479 | window.winClient().setTitle(text); | 483 | window.winClient().setTitle(text); |