diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2011-03-20 06:42:59 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2011-03-20 06:42:59 +0000 |
| commit | 4e01c64b6094fa1f4bf63ec8a8f77cf21696b711 (patch) | |
| tree | 8d6c7ae3f223f537457c55d3976d269772431eb9 /src/libnrtype | |
| parent | Filters. Fix for Bug #737813 (translucent filter crashes program when resizin... (diff) | |
| download | inkscape-4e01c64b6094fa1f4bf63ec8a8f77cf21696b711.tar.gz inkscape-4e01c64b6094fa1f4bf63ec8a8f77cf21696b711.zip | |
Cleaned up memory patch. Fixes bug #737298.
Fixed bugs:
- https://launchpad.net/bugs/737298
(bzr r10118)
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 41533e0ab..7fc0a9715 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -371,7 +371,10 @@ Glib::ustring font_factory::ConstructFontSpecification(PangoFontDescription *fon PangoFontDescription *copy = pango_font_description_copy(font); pango_font_description_unset_fields (copy, PANGO_FONT_MASK_SIZE); - pangoString = Glib::ustring(pango_font_description_to_string(copy)); + char * copyAsString = pango_font_description_to_string(copy); + pangoString = copyAsString; + g_free(copyAsString); + copyAsString = 0; pango_font_description_free(copy); @@ -420,8 +423,11 @@ Glib::ustring font_factory::GetUIStyleString(PangoFontDescription const *fontDes pango_font_description_unset_fields(fontDescrCopy, PANGO_FONT_MASK_SIZE); // For now, keep it as style name taken from pango - style = pango_font_description_to_string(fontDescrCopy); + char *fontDescrAsString = pango_font_description_to_string(fontDescrCopy); + style = fontDescrAsString; + g_free(fontDescrAsString); + fontDescrAsString = 0; pango_font_description_free(fontDescrCopy); } @@ -745,7 +751,11 @@ void font_factory::GetUIFamiliesAndStyles(FamilyToStylesMap *map) } } } + g_free(faces); + faces = 0; } + g_free(families); + families = 0; // Sort the style lists for (FamilyToStylesMap::iterator iter = map->begin() ; iter != map->end(); iter++) { |
