summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
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/widget
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/widget')
-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
3 files changed, 6 insertions, 5 deletions
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 );
}