From 066fc7805c7835334c046d8b0717cbd8b6d7acae Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 10 Jul 2002 15:33:52 +0000 Subject: 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 --- src/Fl_Text_Display.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 $". // -- cgit v1.2.3