Really fix 1674142: Correct the change made in r265. We need to process the pending...
[synfig.git] / synfig-studio / trunk / src / gtkmm / instance.cpp
index 75f6fdf..6c4b6cb 100644 (file)
@@ -319,11 +319,12 @@ Instance::close()
        for(std::list<etl::handle<CanvasView> >::iterator iter=canvas_view_list().begin();iter!=canvas_view_list().end();iter++)
                (*iter)->hide();
 
+       // Consume pending events before deleting the canvas views
+       while(studio::App::events_pending())studio::App::iteration(false);
+
        // Delete all of the canvas views
        canvas_view_list().clear();
 
-       while(studio::App::events_pending())studio::App::iteration(false);
-
        // If there is another open instance to select,
        // go ahead and do so. If not, never mind.
        if(studio::App::instance_list.empty())