Code

remove extra unref; now ref/unref is done by show/hide; this used to stop this arenai...
authorbuliabyak <buliabyak@users.sourceforge.net>
Tue, 16 Sep 2008 16:31:48 +0000 (16:31 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Tue, 16 Sep 2008 16:31:48 +0000 (16:31 +0000)
18 files changed:
src/desktop.cpp
src/extension/internal/cairo-pdf-out.cpp
src/extension/internal/cairo-png-out.cpp
src/extension/internal/cairo-ps-out.cpp
src/extension/internal/cairo-renderer-pdf-out.cpp
src/extension/internal/emf-win32-inout.cpp
src/extension/internal/latex-pstricks-out.cpp
src/flood-context.cpp
src/helper/png-write.cpp
src/print.cpp
src/sp-clippath.cpp
src/sp-item-group.cpp
src/sp-mask.cpp
src/sp-pattern.cpp
src/sp-switch.cpp
src/sp-use.cpp
src/svg-view.cpp
src/ui/dialog/filedialogimpl-win32.cpp

index 476f1e3d76acc9ea88b4b9bc8d79784b0fa205f9..5267bca572d7ab492451ef88249fa8d3876acb63 100644 (file)
@@ -270,7 +270,6 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas)
             SP_ITEM_SHOW_DISPLAY);
     if (ai) {
         nr_arena_item_add_child (SP_CANVAS_ARENA (drawing)->root, ai, NULL);
-        nr_arena_item_unref (ai);
     }
 
     namedview->show(this);
@@ -1399,7 +1398,6 @@ SPDesktop::setDocument (SPDocument *doc)
                 SP_ITEM_SHOW_DISPLAY);
         if (ai) {
             nr_arena_item_add_child (SP_CANVAS_ARENA (drawing)->root, ai, NULL);
-            nr_arena_item_unref (ai);
         }
         namedview->show(this);
         /* Ugly hack */
index 93dad1e6436f9b1bc280d2a693a49007d21209b7..ac598b9a0ff1120918aadd5789583b0d1a905ded 100644 (file)
@@ -93,7 +93,6 @@ pdf_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int
     /* Release arena */
     sp_item_invoke_hide(mod->base, mod->dkey);
     mod->base = NULL;
-    nr_arena_item_unref(mod->root);
     mod->root = NULL;
     nr_object_unref((NRObject *) mod->arena);
     mod->arena = NULL;
index 6a7295dd85cffad9a5791185021059fb45219594..744d59f755f8cb249516473d1da3e01600e94400 100644 (file)
@@ -77,7 +77,6 @@ png_render_document_to_file(SPDocument *doc, gchar const *filename)
 
     /* Release arena */
     sp_item_invoke_hide(base, dkey);
-    nr_arena_item_unref(root);
     nr_object_unref((NRObject *) arena);
 /* end */
     delete renderer;
index 9776dafca88d39051bce0f5739b7433dae9c12b4..fba0ab5713b7044f6429cb5bf06cbcd627869bae 100644 (file)
@@ -97,7 +97,6 @@ ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int l
 
     /* Release arena */
     sp_item_invoke_hide(base, dkey);
-    nr_arena_item_unref(root);
     nr_object_unref((NRObject *) arena);
 /* end */
     delete renderer;
index 96366e5928dbce6aae8a24163ad383daab7c8dfb..4e6c74dff6fb3f60db98619228b05aa88969819f 100644 (file)
@@ -97,7 +97,6 @@ pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int
 
     /* Release arena */
     sp_item_invoke_hide(base, dkey);
-    nr_arena_item_unref(root);
     nr_object_unref((NRObject *) arena);
 /* end */
     renderer->destroyContext(ctx);
index d0e2e881024dfd89fbc5beb6ddcc2d091609b6b5..8dd793f9238063e93af01d04183c3ffb41362f11 100644 (file)
@@ -136,7 +136,6 @@ emf_print_document_to_file(SPDocument *doc, gchar const *filename)
     /* Release arena */
     sp_item_invoke_hide(mod->base, mod->dkey);
     mod->base = NULL;
-    nr_arena_item_unref(mod->root);
     mod->root = NULL;
     nr_object_unref((NRObject *) mod->arena);
     mod->arena = NULL;
index 2dced1d3213f1034b48d09b79f408c38dcefe4b3..8d89951ce347972250bfbb9afe3b0d4267e6043e 100644 (file)
@@ -77,7 +77,6 @@ LatexOutput::save (Inkscape::Extension::Output *mod2, SPDocument *doc, const gch
     /* Release arena */
     sp_item_invoke_hide (mod->base, mod->dkey);
     mod->base = NULL;
-    nr_arena_item_unref (mod->root);
     mod->root = NULL;
     nr_object_unref ((NRObject *) mod->arena);
     mod->arena = NULL;
index 1057fd4be928fc634229036b1eb41a7f02a55d89..22eee64681cb1a8a1f8cdcecebfca618f84e2676 100644 (file)
@@ -874,7 +874,6 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
     // Hide items
     sp_item_invoke_hide(SP_ITEM(sp_document_root(document)), dkey);
     
-    nr_arena_item_unref(root);
     nr_object_unref((NRObject *) arena);
     
     guchar *trace_px = g_new(guchar, width * height);
index 84816ad9c7b52454a8176bb37d675e286026b72b..dd42e9ca1f6c8ecbc54daac727f354e739602825 100644 (file)
@@ -386,11 +386,10 @@ sp_export_png_file(SPDocument *doc, gchar const *filename,
         g_free(ebp.px);
     }
 
-    // Hide items
+    // Hide items, this releases arenaitem
     sp_item_invoke_hide(SP_ITEM(sp_document_root(doc)), dkey);
 
-    /* Free Arena and ArenaItem */
-    nr_arena_item_unref(ebp.root);
+    /* Free arena */
     nr_object_unref((NRObject *) arena);
 
     // restore saved blur quality
index 7b032fe4e41801102b0a9dc776abca6f7ea34a3d..044dffe345102d60d107d37b61756d11cf7827de 100644 (file)
@@ -113,7 +113,6 @@ sp_print_preview_document(SPDocument *doc)
         /* Release arena */
         sp_item_invoke_hide(mod->base, mod->dkey);
         mod->base = NULL;
-        nr_arena_item_unref(mod->root);
         mod->root = NULL;
         nr_object_unref((NRObject *) mod->arena);
         mod->arena = NULL;
@@ -140,7 +139,6 @@ sp_print_document(Gtk::Window& parentWindow, SPDocument *doc)
 
     // Release arena
     sp_item_invoke_hide(base, dkey);
-    nr_arena_item_unref(root);
     nr_object_unref((NRObject *) arena);
 }
 
@@ -175,7 +173,6 @@ sp_print_document_to_file(SPDocument *doc, gchar const *filename)
     /* Release arena */
     sp_item_invoke_hide(mod->base, mod->dkey);
     mod->base = NULL;
-    nr_arena_item_unref(mod->root);
     mod->root = NULL;
     nr_object_unref((NRObject *) mod->arena);
     mod->arena = NULL;
index f56564cbee6a4712212c94d42084e87ab6184fb7..a412694b3a712c84db67f3484089ea7ca3d5966b 100644 (file)
@@ -171,7 +171,6 @@ sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::
                                                   SP_ITEM_REFERENCE_FLAGS);
             if (ac) {
                 nr_arena_item_add_child(v->arenaitem, ac, NULL);
-                nr_arena_item_unref(ac);
             }
         }
     }
@@ -271,7 +270,6 @@ sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key)
             if (ac) {
                 /* The order is not important in clippath */
                 nr_arena_item_add_child(ai, ac, NULL);
-                nr_arena_item_unref(ac);
             }
         }
     }
index 38bf03bdccc2ecfadae582530ecd388c0d877f4d..cd3019d8e4449007f5f40e268a79f037035fdbfd 100644 (file)
@@ -605,7 +605,6 @@ void CGroup::onChildAdded(Inkscape::XML::Node *child) {
 
                 if (ac) {
                     nr_arena_item_append_child (v->arenaitem, ac);
-                    nr_arena_item_unref (ac);
                 }
             }
         }
@@ -624,7 +623,6 @@ void CGroup::onChildAdded(Inkscape::XML::Node *child) {
                 if (ac) {
                     nr_arena_item_add_child (v->arenaitem, ac, NULL);
                     nr_arena_item_set_order (ac, position);
-                    nr_arena_item_unref (ac);
                 }
             }
         }
@@ -774,7 +772,6 @@ void CGroup::_showChildren (NRArena *arena, NRArenaItem *ai, unsigned int key, u
             if (ac) {
                 nr_arena_item_add_child (ai, ac, ar);
                 ar = ac;
-                nr_arena_item_unref (ac);
             }
         }
         l = g_slist_remove (l, o);
index c6febeb40280c9204a5d6d48b969e48be68b5958..49a40f4caf3cb4b874932481d391ed8f2cf15a16 100644 (file)
@@ -186,7 +186,6 @@ sp_mask_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML
                                                               SP_ITEM_REFERENCE_FLAGS);
                        if (ac) {
                                nr_arena_item_add_child (v->arenaitem, ac, NULL);
-                               nr_arena_item_unref (ac);
                        }
                }
        }
@@ -318,7 +317,6 @@ sp_mask_show (SPMask *mask, NRArena *arena, unsigned int key)
                        if (ac) {
                                /* The order is not important in mask */
                                nr_arena_item_add_child (ai, ac, NULL);
-                               nr_arena_item_unref (ac);
                        }
                }
        }
index f89562d256bb9187529acab04512a3c89f4df43e..f7c8a03fc508d8ef2b24bfaf839c8c2d681bb765 100644 (file)
@@ -724,7 +724,6 @@ sp_pattern_painter_new (SPPaintServer *ps, NR::Matrix const &full_transform, NR:
                                        NRArenaItem *cai;
                                        cai = sp_item_invoke_show (SP_ITEM (child), pp->arena, pp->dkey, SP_ITEM_REFERENCE_FLAGS);
                                        nr_arena_item_append_child (pp->root, cai);
-                                       nr_arena_item_unref (cai);
                                }
                        }
                        break; // do not go further up the chain if children are found
index 9be85785d8c97522127fb1f194d567a18157f289..37be6f75eef0b384e418c3ade98eec793fb86b89 100644 (file)
@@ -172,7 +172,6 @@ void CSwitch::_showChildren (NRArena *arena, NRArenaItem *ai, unsigned int key,
             if (ac) {
                 nr_arena_item_add_child (ai, ac, ar);
                 ar = ac;
-                nr_arena_item_unref (ac);
             }
         }
         l = g_slist_remove (l, o);
index 2af7e1394569c5d34cba2eaf686e016f52b9ad9c..50b657728fbd3f35d14e5784202c4bae90497699 100644 (file)
@@ -344,7 +344,6 @@ sp_use_show(SPItem *item, NRArena *arena, unsigned key, unsigned flags)
         NRArenaItem *ac = sp_item_invoke_show(SP_ITEM(use->child), arena, key, flags);
         if (ac) {
             nr_arena_item_add_child(ai, ac, NULL);
-            nr_arena_item_unref(ac);
         }
         NR::translate t(use->x.computed,
                         use->y.computed);
@@ -529,7 +528,6 @@ sp_use_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPUse *use)
                     ai = sp_item_invoke_show(SP_ITEM(use->child), NR_ARENA_ITEM_ARENA(v->arenaitem), v->key, v->flags);
                     if (ai) {
                         nr_arena_item_add_child(v->arenaitem, ai, NULL);
-                        nr_arena_item_unref(ai);
                     }
                 }
 
index 1ca269d7043367a985397c6dfe893fef2489fe2a..c4e35a2c9c04bb15b2249c613de462fd1ba62d86 100644 (file)
@@ -208,7 +208,6 @@ SPSVGView::setDocument (SPDocument *document)
 
         if (ai) {
             nr_arena_item_add_child (SP_CANVAS_ARENA (_drawing)->root, ai, NULL);
-            nr_arena_item_unref (ai);
         }
 
         doRescale (!_rescale);
index ab0a8ec6333e9edc42459e2219bdcaafbeb43ac5..e2d0449084e2bff8c15b2ba6154eff216a1dc453 100644 (file)
@@ -913,7 +913,6 @@ bool FileOpenDialogImplWin32::set_svg_preview()
     // Tidy up
     sp_document_unref(svgDoc);
     sp_item_invoke_hide((SPItem*)(svgDoc->root), key);
-    nr_arena_item_unref(root);
     nr_object_unref((NRObject *) arena);
 
     // Create the GDK pixbuf