diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2014-03-03 21:44:59 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2014-03-03 21:44:59 +0000 |
| commit | ad5c6ceab1420aabbe4c751080bce8b2363abd11 (patch) | |
| tree | 43972a4d86b3e463b0110d009bd1aba10d154249 /src | |
| parent | code cleanup (diff) | |
| download | inkscape-ad5c6ceab1420aabbe4c751080bce8b2363abd11.tar.gz inkscape-ad5c6ceab1420aabbe4c751080bce8b2363abd11.zip | |
More memory leak fixes (Bug #1275170)
(bzr r13105)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/internal/javafx-out.cpp | 4 | ||||
| -rw-r--r-- | src/sp-conn-end-pair.cpp | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp index 035a6f0aa..e51e8d539 100644 --- a/src/extension/internal/javafx-out.cpp +++ b/src/extension/internal/javafx-out.cpp @@ -396,12 +396,14 @@ bool JavaFXOutput::doStyle(SPStyle *style) } else if (fill.isPaintserver()){ if (fill.value.href && fill.value.href->getURI() ){ - String uri = fill.value.href->getURI()->toString(); + gchar *str = fill.value.href->getURI()->toString(); + String uri = (str ? str : ""); /* trim the anchor '#' from the front */ if (uri.size() > 0 && uri[0]=='#') { uri = uri.substr(1); } out(" fill: %s()\n", sanatize(uri).c_str()); + g_free(str); } } diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp index 52a421550..dbd4f2e94 100644 --- a/src/sp-conn-end-pair.cpp +++ b/src/sp-conn-end-pair.cpp @@ -171,8 +171,11 @@ SPConnEndPair::writeRepr(Inkscape::XML::Node *const repr) const { char const * const attr_strs[] = {"inkscape:connection-start", "inkscape:connection-end"}; for (unsigned handle_ix = 0; handle_ix < 2; ++handle_ix) { - if (this->_connEnd[handle_ix]->ref.getURI()) { - repr->setAttribute(attr_strs[handle_ix], this->_connEnd[handle_ix]->ref.getURI()->toString()); + const Inkscape::URI* U = this->_connEnd[handle_ix]->ref.getURI(); + if (U) { + gchar *str = U->toString(); + repr->setAttribute(attr_strs[handle_ix], str); + g_free(str); } } repr->setAttribute("inkscape:connector-curvature", Glib::Ascii::dtostr(_connCurvature).c_str()); |
