Author: spitzak
Date: 2007-07-03 16:44:12 -0400 (Tue, 03 Jul 2007)
New Revision: 5922
Log:
Fixed a memory leak when an empty group is deleted.
Modified:
trunk/src/Group.cxx
Modified: trunk/src/Group.cxx
===================================================================
--- trunk/src/Group.cxx 2007-07-03 17:28:59 UTC (rev 5921)
+++ trunk/src/Group.cxx 2007-07-03 20:44:12 UTC (rev 5922)
@@ -106,7 +106,6 @@
Widget*const* a = array_;
Widget*const* e = a+children_;
// clear everything now, in case fix_focus recursively calls us:
- array_ = 0;
children_ = 0;
focus_index_ = -1;
if (resizable_) resizable_ = this;
@@ -116,8 +115,9 @@
o->parent(0); // stops it from calling remove()
delete o;
}
- delete[] const_cast<Widget**>( a );
}
+ delete[] const_cast<Widget**>( array_ );
+ array_ = 0;
}
/*! Calls clear(), and thus <i>deletes all child widgets</i> */
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit