Skip to content

Commit

Permalink
STR #878: fixed tiny memory leak when calling Fl_Widget::label(label(…
Browse files Browse the repository at this point in the history
…)) which happens when assigning a window icon.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4412 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Matthias Melcher committed Jul 11, 2005
1 parent 88bb4a5 commit 13cb2bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -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'.
Expand Down
3 changes: 3 additions & 0 deletions src/Fl_Widget.cxx
Expand Up @@ -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);
}
Expand Down

0 comments on commit 13cb2bc

Please sign in to comment.