2015-05-04 Carl Hetherington <cth@carlh.net>
+ * Don't try to update config dialog when its window has been
+ destroyed. Fixes various crashes on Windows (from master).
+
* Add a simple content properties dialog (#554).
2015-05-01 carl <cth@carlh.net>
: _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)
{
_panel->SetSizer (s);
setup ();
- _created = true;
+ _window_exists = true;
config_changed ();
+
+ _panel->Bind (wxEVT_DESTROY, boost::bind (&Page::window_destroyed, this));
return _panel;
}
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