summaryrefslogtreecommitdiff
path: root/src/Fl_Widget.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-07-11 21:05:45 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-07-11 21:05:45 +0000
commit13cb2bc18c6332ef63d7b96c4181ff30af415c5a (patch)
treec0b402550e4c74d80eda23de5470ff5773b06ec4 /src/Fl_Widget.cxx
parent88bb4a58d30cf36150fd40353b82ba82a83c5127 (diff)
STR #878: fixed tiny memory leak when calling Fl_Widget::label(label()) which happens when assigning a window icon.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4412 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Widget.cxx')
-rw-r--r--src/Fl_Widget.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx
index bf198d7dd..a94764346 100644
--- a/src/Fl_Widget.cxx
+++ b/src/Fl_Widget.cxx
@@ -253,6 +253,9 @@ int Fl_Widget::contains(const Fl_Widget *o) const {
void
Fl_Widget::label(const char *a) {
if (flags() & COPIED_LABEL) {
+ // reassigning a copied label remains the same copied label
+ if (label_.value == a)
+ return;
free((void *)(label_.value));
clear_flag(COPIED_LABEL);
}