diff options
| author | Jabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es> | 2017-11-17 12:12:00 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-17 15:09:58 +0000 |
| commit | 73c2b3f8807b5230fe0c32f6168edfa5392be7da (patch) | |
| tree | b003d44228c2a5439f1675c1063850716b8f6cf5 /src | |
| parent | Break Tango icons into individual files and install in proper location. (diff) | |
| download | inkscape-73c2b3f8807b5230fe0c32f6168edfa5392be7da.tar.gz inkscape-73c2b3f8807b5230fe0c32f6168edfa5392be7da.zip | |
Fix memleaks and double call to title() in a recursive function in Symbols Dialog
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index fda1825da..7b34aa23d 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -888,11 +888,13 @@ void SymbolsDialog::symbolsInDocRecursive (SPObject *r, std::map<Glib::ustring, if ( dynamic_cast<SPSymbol *>(r)) { Glib::ustring id = r->getAttribute("id"); - if(r->title()) { - l[doc_title + r->title() + id] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); + gchar * title = r->title(); + if(title) { + l[doc_title + title + id] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); } else { l[Glib::ustring(_("notitle_")) + id] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); } + g_free(title); } for (auto& child: r->children) { symbolsInDocRecursive(&child, l, doc_title); |
