Permalink
Browse files

Revert "Fix on-close bug: Crash when file is closed and params panel …

…is scrolled down."

This reverts commit e3edf4b.
  • Loading branch information...
1 parent 89de649 commit 24b8f3be1bd6c0b6f6799b316a65274c42ccd2e2 @morevnaproject committed Jul 5, 2012
Showing with 9 additions and 7 deletions.
  1. +9 −6 synfig-studio/src/gui/docks/dock_params.cpp
  2. +0 −1 synfig-studio/src/gui/docks/dock_params.h
@@ -75,7 +75,9 @@ Dock_Params::~Dock_Params()
void
Dock_Params::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
{
- tree_view=static_cast<Gtk::TreeView*>(canvas_view->get_ext_widget(get_name()));
+ Gtk::TreeView* tree_view(
+ static_cast<Gtk::TreeView*>(canvas_view->get_ext_widget(get_name()))
+ );
if(tree_view)
{
@@ -91,6 +93,9 @@ Dock_Params::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
void
Dock_Params::refresh_selected_param()
{
+ Gtk::TreeView* tree_view(
+ static_cast<Gtk::TreeView*>(get_canvas_view()->get_ext_widget(get_name()))
+ );
Gtk::TreeModel::iterator iter(tree_view->get_selection()->get_selected());
if(iter)
@@ -111,13 +116,11 @@ Dock_Params::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view
{
if(canvas_view)
{
- tree_view=static_cast<Gtk::TreeView*>(canvas_view->get_ext_widget(get_name()));
-
+ Gtk::Widget* tree_view(canvas_view->get_ext_widget(get_name()));
+
add(*tree_view);
tree_view->show();
show_all();
- } else {
- tree_view->hide();
- clear_previous();
}
+ else clear_previous();
}
@@ -43,7 +43,6 @@ namespace studio {
class Dock_Params : public Dock_CanvasSpecific
{
Glib::RefPtr<Gtk::ActionGroup> action_group;
- Gtk::TreeView *tree_view;
protected:
virtual void init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view);

0 comments on commit 24b8f3b

Please sign in to comment.