Permalink
Browse files

Fix on-close bug: Crash when file is closed and child panel is scroll…

…ed down.
  • Loading branch information...
1 parent e3edf4b commit 89de6490898ae8241ccb7addb7bac821ee7df131 @morevnaproject committed Jul 1, 2012
Showing with 10 additions and 6 deletions.
  1. +8 −6 synfig-studio/src/gui/docks/dock_children.cpp
  2. +2 −0 synfig-studio/src/gui/docks/dock_children.h
@@ -83,25 +83,27 @@ Dock_Children::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
Glib::RefPtr<ChildrenTreeStore> children_tree_store;
children_tree_store=ChildrenTreeStore::create(canvas_view->canvas_interface());
- ChildrenTree* children_tree(new ChildrenTree());
- children_tree->set_model(children_tree_store);
- children_tree->set_time_adjustment(canvas_view->time_adjustment());
+ tree_view = new ChildrenTree();
+ tree_view->set_model(children_tree_store);
+ tree_view->set_time_adjustment(canvas_view->time_adjustment());
canvas_view->set_tree_model(get_name(),children_tree_store);
- canvas_view->set_ext_widget(get_name(),children_tree);
+ canvas_view->set_ext_widget(get_name(),tree_view);
}
void
Dock_Children::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
{
if(canvas_view)
{
- Gtk::Widget* tree_view(canvas_view->get_ext_widget(get_name()));
+ tree_view=static_cast<studio::ChildrenTree*>(canvas_view->get_ext_widget(get_name()));
add(*tree_view);
tree_view->show();
+ } else {
+ tree_view->hide();
+ clear_previous();
}
- else clear_previous();
}
@@ -31,6 +31,7 @@
#include <gtkmm/treeview.h>
#include "instance.h"
#include "docks/dock_canvasspecific.h"
+#include "trees/childrentree.h"
/* === M A C R O S ========================================================= */
@@ -42,6 +43,7 @@ namespace studio {
class Dock_Children : public Dock_CanvasSpecific
{
+ ChildrenTree *tree_view;
protected:
virtual void init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view);
virtual void changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view);

0 comments on commit 89de649

Please sign in to comment.