fix crash when trying to set the title on a window that's already closed
This commit is contained in:
parent
8e97963e42
commit
ea9f80399b
2 changed files with 10 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue