diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Preferences.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 18a66bfee..dabaa09c0 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -87,7 +87,7 @@ Fl_Preferences::Fl_Preferences( const char *path, const char *vendor, const char */ Fl_Preferences::Fl_Preferences( Fl_Preferences &parent, const char *key ) { - rootNode = 0; + rootNode = parent.rootNode; node = parent.node->addChild( key ); } @@ -100,7 +100,7 @@ Fl_Preferences::Fl_Preferences( Fl_Preferences &parent, const char *key ) */ Fl_Preferences::Fl_Preferences( Fl_Preferences *parent, const char *key ) { - rootNode = 0; + rootNode = parent->rootNode; node = parent->node->addChild( key ); } @@ -112,7 +112,7 @@ Fl_Preferences::Fl_Preferences( Fl_Preferences *parent, const char *key ) */ Fl_Preferences::~Fl_Preferences() { - delete rootNode; + if (!node->parent()) delete rootNode; // DO NOT delete nodes! The root node will do that after writing the preferences } |
