diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-29 15:12:23 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-29 15:12:23 +0000 |
| commit | 6bfe3e970a4774e868e2a6e4a03a9b964ae3bfac (patch) | |
| tree | 3a9abb84ad77fc5fd1ebc782e858532251ae43bd | |
| parent | 782b3d639a7624756690a84b87fc2e8314070d97 (diff) | |
Fix uninitialized variable in Fl_Preferences::Node::remove.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2128 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Preferences.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 526222d85..ddeaae5d3 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Preferences.cxx,v 1.1.2.1 2002/04/28 16:41:16 easysw Exp $" +// "$Id: Fl_Preferences.cxx,v 1.1.2.2 2002/04/29 15:12:23 easysw Exp $" // // Preferences file for the Fast Light Tool Kit (FLTK). // @@ -803,13 +803,10 @@ const char *Fl_Preferences::Node::child( int ix ) int Fl_Preferences::Node::remove() { Node *nd, *np; - if ( parent_ ) - { - nd = parent_->child_; np = 0L; - for ( ; nd; nd = nd->next_ ) - { - if ( nd == this ) - { + if ( parent_ ) { + nd = parent_->child_; np = 0; + for ( ; nd; nd = nd->next_ ) { + if ( nd == this ) { if ( np ) np->next_ = nd->next_; else @@ -817,12 +814,14 @@ int Fl_Preferences::Node::remove() break; } } - } + } else nd = 0; + delete this; + return ( nd != 0 ); } // -// End of "$Id: Fl_Preferences.cxx,v 1.1.2.1 2002/04/28 16:41:16 easysw Exp $". +// End of "$Id: Fl_Preferences.cxx,v 1.1.2.2 2002/04/29 15:12:23 easysw Exp $". // |
