aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flitem.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-04-19 02:32:31 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-04-19 02:32:31 +0000
commit0aac9d7803bc367ec22ed9df292d8a71d6013b55 (patch)
tree7ae307e7702884375d7da9dde0a630e419ea88ce /externals/grill/flext/source/flitem.cpp
parentda9c21b096e47f09ab24279b17d293aead832ad2 (diff)
""
svn path=/trunk/; revision=578
Diffstat (limited to 'externals/grill/flext/source/flitem.cpp')
-rwxr-xr-xexternals/grill/flext/source/flitem.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/externals/grill/flext/source/flitem.cpp b/externals/grill/flext/source/flitem.cpp
index 7af91fea..1980f26c 100755
--- a/externals/grill/flext/source/flitem.cpp
+++ b/externals/grill/flext/source/flitem.cpp
@@ -30,16 +30,20 @@ flext_base::itemarr::itemarr():
arr(new item *[2]),cnt(0),bits(-1)
{
arr[0] = arr[1] = NULL;
-// post("NEWARR %p",this);
}
flext_base::itemarr::~itemarr()
{
-// post("DELARR %p",this);
- int c = Ready()?Size():2;
+ if(Ready()) {
+ // if finalized, the array has several slots
+ int c = Size();
+ for(int i = 0; i < c; ++i)
+ if(arr[i]) delete arr[i];
+ }
+ else
+ // the array only has a head (arr[0]) and a tail (arr[1]) pointer
+ delete arr[0];
- for(int i = 0; i < c; ++i)
- if(arr[i]) delete arr[i];
delete[] arr;
}