[master] a900411 - Better solution for issue #296

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] a900411 - Better solution for issue #296 "Greg Ercolano" 15:17 Nov 24 top right image
 
commit a900411ee26ec1e40b82c833c7b9855948dd1e6b
Author:     Greg Ercolano <erco@seriss.com>
AuthorDate: Wed Nov 24 15:13:04 2021 -0800
Commit:     Greg Ercolano <erco@seriss.com>
CommitDate: Wed Nov 24 15:13:04 2021 -0800

    Better solution for issue #296

 src/Fl_Table_Row.cxx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git src/Fl_Table_Row.cxx src/Fl_Table_Row.cxx
index 3a091ff..e800455 100644
--- src/Fl_Table_Row.cxx
+++ src/Fl_Table_Row.cxx
@@ -51,7 +51,12 @@ Fl_Table_Row::CharVector::~CharVector() {       // DTOR
 }
 
 void Fl_Table_Row::CharVector::size(int count) {
-  if (count <= 0 ) count = 1;    // (issue #296)
+  if (count <= 0 ) {    // Same state as init() - (issue #296)
+    if ( arr ) free(arr);
+    arr   = 0;
+    _size = 0;
+    return;
+  }
   if (count != _size) {
     arr = (char*)realloc(arr, (unsigned)count * sizeof(char));
     _size = count;
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.