summaryrefslogtreecommitdiffstats
path: root/src/widgets/desktop-widget.cpp
diff options
context:
space:
mode:
authorMoritz Eberl <moritz@semiodesk.com>2016-04-16 17:24:08 +0000
committerMoritz Eberl <moritz@semiodesk.com>2016-04-16 17:24:08 +0000
commit69cb9b68955f341000342bcf3b90cfd4c41a1fd8 (patch)
treeb6061c25987d6300bd03189c03259d66bab7c0b6 /src/widgets/desktop-widget.cpp
parentAdded Sebastian Faubels helper scripts for windows. (diff)
parentCMake build: builds with WITH_DBUS (diff)
downloadinkscape-69cb9b68955f341000342bcf3b90cfd4c41a1fd8.tar.gz
inkscape-69cb9b68955f341000342bcf3b90cfd4c41a1fd8.zip
merge and fixed build
(bzr r14761.1.11)
Diffstat (limited to 'src/widgets/desktop-widget.cpp')
-rw-r--r--src/widgets/desktop-widget.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 759be551f..fe724a964 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -1698,8 +1698,11 @@ void SPDesktopWidget::setToolboxPosition(Glib::ustring const& id, GtkPositionTyp
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
if ( gtk_widget_is_ancestor(toolbox, hbox) ) {
+ // Removing a widget can reduce ref count to zero
+ g_object_ref(G_OBJECT(toolbox));
gtk_container_remove(GTK_CONTAINER(hbox), toolbox);
gtk_container_add(GTK_CONTAINER(vbox), toolbox);
+ g_object_unref(G_OBJECT(toolbox));
gtk_box_set_child_packing(GTK_BOX(vbox), toolbox, FALSE, TRUE, 0, GTK_PACK_START);
}
ToolboxFactory::setOrientation(toolbox, GTK_ORIENTATION_HORIZONTAL);
@@ -1707,8 +1710,10 @@ void SPDesktopWidget::setToolboxPosition(Glib::ustring const& id, GtkPositionTyp
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
if ( !gtk_widget_is_ancestor(toolbox, hbox) ) {
+ g_object_ref(G_OBJECT(toolbox));
gtk_container_remove(GTK_CONTAINER(vbox), toolbox);
gtk_container_add(GTK_CONTAINER(hbox), toolbox);
+ g_object_unref(G_OBJECT(toolbox));
gtk_box_set_child_packing(GTK_BOX(hbox), toolbox, FALSE, TRUE, 0, GTK_PACK_START);
if (pos == GTK_POS_LEFT) {
gtk_box_reorder_child( GTK_BOX(hbox), toolbox, 0 );