diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-07-10 15:33:52 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-07-10 15:33:52 +0000 |
| commit | 066fc7805c7835334c046d8b0717cbd8b6d7acae (patch) | |
| tree | 32f90dbbb829adc581048dcd544a4cfd691257ca | |
| parent | 32fee075fbcbe9e6290cf2a3e5b521a789ca0639 (diff) | |
Only delete the line starts array if it is not NULL.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2501 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Text_Display.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 167e56478..e1d67fef5 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Display.cxx,v 1.12.2.20 2002/07/08 17:15:35 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.21 2002/07/10 15:33:52 easysw Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -129,7 +129,7 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) */ Fl_Text_Display::~Fl_Text_Display() { if (mBuffer) mBuffer->remove_modify_callback(buffer_modified_cb, this); - delete[] mLineStarts; + if (mLineStarts) delete[] mLineStarts; } /* @@ -224,7 +224,7 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) { int nvlines = (text_area.h + mMaxsize - 1) / mMaxsize; if (mNVisibleLines != nvlines) { mNVisibleLines = nvlines; - delete[] mLineStarts; + if (mLineStarts) delete[] mLineStarts; mLineStarts = new int [mNVisibleLines]; calc_line_starts(0, mNVisibleLines); calc_last_char(); @@ -1954,5 +1954,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.20 2002/07/08 17:15:35 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.21 2002/07/10 15:33:52 easysw Exp $". // |
