diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2007-06-20 13:07:23 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2007-06-20 13:07:23 +0000 |
| commit | 4261960ba477021e3a319f520ac0b64c1842aac7 (patch) | |
| tree | 64998d4cab66f950921fee60bd70551d9bbb1a5c /src | |
| parent | 413d9295ace48c99bc66b1f9ac722e87cc851227 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Preferences.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 5f70d0711..83103819a 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -116,7 +116,7 @@ Fl_Preferences::Fl_Preferences( Fl_Preferences *parent, const char *key ) */ 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 // zero all pointer to avoid memory errors, event though // Valgrind does not complain (Cygwind does though) @@ -757,7 +757,7 @@ Fl_Preferences::RootNode::~RootNode() application_ = 0L; } delete prefs_->node; - prefs_ = 0L; + prefs_->node = 0L; } // read a preferences file and construct the group tree and with all entry leafs |
