summaryrefslogtreecommitdiff
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
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
-rw-r--r--CHANGES1
-rw-r--r--src/Fl_Widget.cxx3
2 files changed, 4 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index a3d797c5d..8a1b92948 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745)
+ - Fixed tiny memory leak (STR #878)
- Fixed hang on corrupt jpeg (STR #915)
- Fixed static allocation of font buffer in demo (STR #909)
- Added symbols 'refresh', 'reload', 'undo', and 'redo'.
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);
}