diff options
author | David Robillard <d@drobilla.net> | 2010-02-20 22:11:04 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-20 22:11:04 +0000 |
commit | 397c2d3338fbfaca09f0717b58c1154e91bbffff (patch) | |
tree | 8f67c1246ccad50b91e81fadfc5e44fa40bb17f3 /src/gui/PropertiesWindow.cpp | |
parent | 46e5de590817756b21a7a5d99bd4963df343f455 (diff) | |
download | ingen-397c2d3338fbfaca09f0717b58c1154e91bbffff.tar.gz ingen-397c2d3338fbfaca09f0717b58c1154e91bbffff.tar.bz2 ingen-397c2d3338fbfaca09f0717b58c1154e91bbffff.zip |
Reset PropertiesWindow on hide (fix crashes when modifying objects formerly shown by properties window). Likely fix for ticket #483.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2469 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/PropertiesWindow.cpp')
-rw-r--r-- | src/gui/PropertiesWindow.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp index 8890770a..44c1c774 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -64,17 +64,27 @@ PropertiesWindow::PropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<G } -/** Set the node this window is associated with. - * This function MUST be called before using this object in any way. - */ void -PropertiesWindow::set_object(SharedPtr<ObjectModel> model) +PropertiesWindow::reset() { _table->children().clear(); _table->resize(1, 3); _table->property_n_rows() = 1; + _records.clear(); + _property_connection.disconnect(); + _model.reset(); +} + + +/** Set the node this window is associated with. + * This function MUST be called before using this object in any way. + */ +void +PropertiesWindow::set_object(SharedPtr<ObjectModel> model) +{ + reset(); _model = model; set_title(model->path().chop_scheme() + " Properties - Ingen"); @@ -264,7 +274,7 @@ bad_type: void PropertiesWindow::cancel_clicked() { - set_object(_model); // reset + reset(); Gtk::Window::hide(); } @@ -295,7 +305,7 @@ void PropertiesWindow::ok_clicked() { apply_clicked(); - Gtk::Window::hide(); + cancel_clicked(); } |