summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-10-10 11:05:48 +0000
committerNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-10-11 11:21:28 +0000
commit487f0940377b4fbf9ebae8ab2a53f2f992e60deb (patch)
tree00ffcad1a7ebd3d958ec76f117f4e67457c4caed /src/ui
parentRemove warnings of unhandled items on Mac check menu items, thanks to Nathan ... (diff)
downloadinkscape-487f0940377b4fbf9ebae8ab2a53f2f992e60deb.tar.gz
inkscape-487f0940377b4fbf9ebae8ab2a53f2f992e60deb.zip
Reduce memory leak on editing text, etc.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/toolbar/text-toolbar.cpp6
-rw-r--r--src/ui/widget/color-icc-selector.cpp4
-rw-r--r--src/ui/widget/combo-box-entry-tool-item.cpp3
-rw-r--r--src/ui/widget/combo-tool-item.cpp4
4 files changed, 11 insertions, 6 deletions
diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp
index 2488d8ec7..f2cf73257 100644
--- a/src/ui/toolbar/text-toolbar.cpp
+++ b/src/ui/toolbar/text-toolbar.cpp
@@ -212,7 +212,9 @@ namespace Toolbar {
TextToolbar::TextToolbar(SPDesktop *desktop)
: Toolbar(desktop)
, _freeze(false)
+ , _text_style_from_prefs(false)
, _outer(true)
+ , _updating(false)
, _tracker(new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR))
, _tracker_fs(new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR))
, _cusor_numbers(0)
@@ -657,7 +659,9 @@ TextToolbar::fontfamily_value_changed()
}
_freeze = true;
- Glib::ustring new_family = _font_family_item->get_active_text();
+ gchar *temp_family = _font_family_item->get_active_text();
+ Glib::ustring new_family(temp_family);
+ g_free(temp_family);
css_font_family_unquote( new_family ); // Remove quotes around font family names.
// TODO: Think about how to handle handle multiple selections. While
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp
index 4862d6d03..31006052b 100644
--- a/src/ui/widget/color-icc-selector.cpp
+++ b/src/ui/widget/color-icc-selector.cpp
@@ -537,9 +537,7 @@ void ColorICCSelectorImpl::_profileSelected(GtkWidget * /*src*/, gpointer data)
self->_switchToProfile(name);
gtk_widget_set_tooltip_text(self->_profileSel, name);
- if (name) {
- g_free(name);
- }
+ g_free(name);
}
}
#endif // defined(HAVE_LIBLCMS2)
diff --git a/src/ui/widget/combo-box-entry-tool-item.cpp b/src/ui/widget/combo-box-entry-tool-item.cpp
index f3786c6f6..11dd8459d 100644
--- a/src/ui/widget/combo-box-entry-tool-item.cpp
+++ b/src/ui/widget/combo-box-entry-tool-item.cpp
@@ -475,6 +475,7 @@ ComboBoxEntryToolItem::get_active_row_from_text(ComboBoxEntryToolItem *action,
// Case sensitive compare
if( strcmp( target_text, text ) == 0 ){
found = true;
+ g_free(text);
break;
}
} else {
@@ -486,9 +487,11 @@ ComboBoxEntryToolItem::get_active_row_from_text(ComboBoxEntryToolItem *action,
g_free( target_text_casefolded );
if( equal ) {
found = true;
+ g_free(text);
break;
}
}
+ g_free(text);
}
++row;
diff --git a/src/ui/widget/combo-tool-item.cpp b/src/ui/widget/combo-tool-item.cpp
index 5e07efdf1..e9eee059d 100644
--- a/src/ui/widget/combo-tool-item.cpp
+++ b/src/ui/widget/combo-tool-item.cpp
@@ -126,12 +126,12 @@ ComboToolItem::populate_combobox()
}
Gtk::CellRendererPixbuf *renderer = new Gtk::CellRendererPixbuf;
renderer->set_property ("stock_size", Gtk::ICON_SIZE_LARGE_TOOLBAR);
- _combobox->pack_start (*renderer, false);
+ _combobox->pack_start (*Gtk::manage(renderer), false);
_combobox->add_attribute (*renderer, "icon_name", columns.col_icon );
} else if (_use_pixbuf) {
Gtk::CellRendererPixbuf *renderer = new Gtk::CellRendererPixbuf;
//renderer->set_property ("stock_size", Gtk::ICON_SIZE_LARGE_TOOLBAR);
- _combobox->pack_start (*renderer, false);
+ _combobox->pack_start (*Gtk::manage(renderer), false);
_combobox->add_attribute (*renderer, "pixbuf", columns.col_pixbuf );
}