mirror of
https://github.com/fltk/fltk.git
synced 2026-06-05 16:12:13 +08:00
STR #1714: fixed bad deallocation (NULL pointer issue) in Fl_Preferences.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5917 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -116,7 +116,7 @@ Fl_Preferences::Fl_Preferences( Fl_Preferences *parent, const char *key )
|
|||||||
*/
|
*/
|
||||||
Fl_Preferences::~Fl_Preferences()
|
Fl_Preferences::~Fl_Preferences()
|
||||||
{
|
{
|
||||||
if (!node->parent()) delete rootNode;
|
if (node && !node->parent()) delete rootNode;
|
||||||
// DO NOT delete nodes! The root node will do that after writing the preferences
|
// DO NOT delete nodes! The root node will do that after writing the preferences
|
||||||
// zero all pointer to avoid memory errors, event though
|
// zero all pointer to avoid memory errors, event though
|
||||||
// Valgrind does not complain (Cygwind does though)
|
// Valgrind does not complain (Cygwind does though)
|
||||||
@@ -757,7 +757,7 @@ Fl_Preferences::RootNode::~RootNode()
|
|||||||
application_ = 0L;
|
application_ = 0L;
|
||||||
}
|
}
|
||||||
delete prefs_->node;
|
delete prefs_->node;
|
||||||
prefs_ = 0L;
|
prefs_->node = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
// read a preferences file and construct the group tree and with all entry leafs
|
// read a preferences file and construct the group tree and with all entry leafs
|
||||||
|
|||||||
Reference in New Issue
Block a user