diff options
| author | Jabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es> | 2017-11-17 12:18:12 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-17 15:09:59 +0000 |
| commit | 666b9584b216d5a662dc60b8245fec8014ee164a (patch) | |
| tree | 698565642f13d341110168c20a9ce654f024e0dc /src | |
| parent | Fix memleaks and double call to title() in a recursive function in Symbols Di... (diff) | |
| download | inkscape-666b9584b216d5a662dc60b8245fec8014ee164a.tar.gz inkscape-666b9584b216d5a662dc60b8245fec8014ee164a.zip | |
More memleaks fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 7b34aa23d..6add2b73d 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -614,9 +614,11 @@ Glib::ustring SymbolsDialog::selectedSymbolDocTitle() { Glib::ustring SymbolsDialog::documentTitle(SPDocument* symbol_doc) { if (symbol_doc) { SPRoot * root = symbol_doc->getRoot(); - if (root->title()) { - return ellipsize(Glib::ustring(root->title()), 33); + gchar * title = root->title(); + if (title) { + return ellipsize(Glib::ustring(title), 33); } + g_free(title); } Glib::ustring current = symbol_set->get_active_text(); if (current == CURRENTDOC) { @@ -1013,8 +1015,8 @@ bool SymbolsDialog::callbackSymbols(){ Glib::ustring doc_title = symbol_data->second.first; SPSymbol * symbol = symbol_data->second.second; counter_symbols ++; - gchar const *symbol_title_char = symbol->title(); - gchar const *symbol_desc_char = symbol->description(); + gchar *symbol_title_char = symbol->title(); + gchar *symbol_desc_char = symbol->description(); bool found = false; if (symbol_title_char) { Glib::ustring symbol_title = Glib::ustring(symbol_title_char).lowercase(); @@ -1039,6 +1041,8 @@ bool SymbolsDialog::callbackSymbols(){ symbol_data = l.erase(l.begin()); //to get more items and best performance int modulus = number_symbols > 200 ? 50 : (number_symbols/4); + g_free(symbol_title_char); + g_free(symbol_desc_char); if (modulus && counter_symbols % modulus == 0 && !l.empty()) { return true; } |
