Memory leak warnings associated with ViewBox

Bug #1249482 reported by David Mathog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

The introduction of the "ViewBox" function is producing "memory possibly lost" warnings when testing emf and wmf files in valgrind. In previous versions the end of EMf::open in emf-inout.cpp was just:

    d.tri = trinfo_release_except_FC(d.tri);
    return doc;
}

Now there is a ~25 line block between those two lines where a bunch of ViewBox and doc actions are performed. In that section, these lines leak:

        doc->ensureUpToDate();

        repr->setAttribute("inkscape:document-units", os.str().c_str());

        doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc_unit), doc->getHeight().value(doc_unit)));

        doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, SP_ACTIVE_DOCUMENT->getHeight().value("px")));

        doc->ensureUpToDate();

That is, roughly every 3rd line in this section of code. The memory lost (maybe) is small, I think 16 bytes in each case.

There is also an ensureUpToDate() call in Emf::print_document_to_file and that one did not trigger one of these warnings, and I know that section was exercised because of the valgrind warning for set_param_string() a few lines away. (That is an old bug, I forget the number.)

Tags: performance
su_v (suv-lp)
tags: added: performance
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.