summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2021-11-24 15:13:04 -0800
committerGreg Ercolano <erco@seriss.com>2021-11-24 15:13:04 -0800
commita900411ee26ec1e40b82c833c7b9855948dd1e6b (patch)
treea0ea84006fb05a1b881897ef8db227c04ee02b79 /src
parente97fd17e04cf400f30e059f532975de1092a9466 (diff)
Better solution for issue #296
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Table_Row.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl_Table_Row.cxx b/src/Fl_Table_Row.cxx
index 3a091ff3d..e800455f8 100644
--- a/src/Fl_Table_Row.cxx
+++ b/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;