diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/config_dialog.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index d5700b892..67ce701f9 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -65,11 +65,13 @@ public: : _border (border) , _panel (0) , _panel_size (panel_size) - , _created (false) + , _window_exists (false) { _config_connection = Config::instance()->Changed.connect (boost::bind (&Page::config_changed_wrapper, this)); } + virtual ~Page () {} + protected: wxWindow* create_window (wxWindow* parent) { @@ -78,8 +80,10 @@ protected: _panel->SetSizer (s); setup (); - _created = true; + _window_exists = true; config_changed (); + + _panel->Bind (wxEVT_DESTROY, boost::bind (&Page::window_destroyed, this)); return _panel; } @@ -93,14 +97,19 @@ private: void config_changed_wrapper () { - if (_created) { + if (_window_exists) { config_changed (); } } + void window_destroyed () + { + _window_exists = false; + } + wxSize _panel_size; boost::signals2::scoped_connection _config_connection; - bool _created; + bool _window_exists; }; class StockPage : public wxStockPreferencesPage, public Page |
