aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/pool/source
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-12-14 01:53:02 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-12-14 01:53:02 +0000
commit59ad9e9cf0a72b31f8bfd371cb97536ed4d4fe61 (patch)
treed424023df43b0a5649bf93b025338f8b76bce244 /externals/grill/pool/source
parentde76301bb4d17339e4eb6eb31abf53ede4734e1e (diff)
fixed double-free on clearing values and dirs
reintroduced missing help message fixed clearing values and dirs, e.g. with messages clrall and clrrec more symbol escaping rename help file svn path=/trunk/; revision=4208
Diffstat (limited to 'externals/grill/pool/source')
-rw-r--r--externals/grill/pool/source/main.cpp8
-rw-r--r--externals/grill/pool/source/pool.cpp9
2 files changed, 14 insertions, 3 deletions
diff --git a/externals/grill/pool/source/main.cpp b/externals/grill/pool/source/main.cpp
index cddf33c0..dfdaa9d0 100644
--- a/externals/grill/pool/source/main.cpp
+++ b/externals/grill/pool/source/main.cpp
@@ -38,6 +38,9 @@ protected:
V ms_pool(const AtomList &l);
V mg_pool(AtomList &l);
+ // print some help message
+ static V m_help() { post("pool " POOL_VERSION " - hierarchical storage object, (C)2002-2005 Thomas Grill"); }
+
// clear all data in pool
V m_reset();
@@ -164,6 +167,8 @@ private:
FLEXT_ATTRVAR_I(vcnt)
FLEXT_ATTRVAR_I(dcnt)
+ FLEXT_CALLBACK(m_help)
+
FLEXT_CALLBACK(m_reset)
FLEXT_CALLBACK(m_getdir)
@@ -234,7 +239,7 @@ const t_symbol *pool::sym_echo;
V pool::setup(t_classid c)
{
post("");
- post("pool %s - hierarchical storage object, (C)2002-2005 Thomas Grill",POOL_VERSION);
+ pool::m_help();
post("");
head = tail = NULL;
@@ -247,6 +252,7 @@ V pool::setup(t_classid c)
FLEXT_CADDATTR_VAR1(c,"valcnt",vcnt);
FLEXT_CADDATTR_VAR1(c,"dircnt",dcnt);
+ FLEXT_CADDMETHOD_(c,0,"help",m_help);
FLEXT_CADDMETHOD_(c,0,"reset",m_reset);
FLEXT_CADDMETHOD_(c,0,"getdir",m_getdir);
FLEXT_CADDMETHOD_(c,0,"mkdir",m_mkdir);
diff --git a/externals/grill/pool/source/pool.cpp b/externals/grill/pool/source/pool.cpp
index 7632998d..1de7994e 100644
--- a/externals/grill/pool/source/pool.cpp
+++ b/externals/grill/pool/source/pool.cpp
@@ -64,7 +64,9 @@ poolval::poolval(const A &k,AtomList *d):
poolval::~poolval()
{
if(data) delete data;
- if(nxt) delete nxt;
+
+// if(nxt) delete nxt;
+ FLEXT_ASSERT(nxt == NULL);
}
poolval &poolval::Set(AtomList *d)
@@ -93,7 +95,8 @@ pooldir::~pooldir()
{
Reset(false);
- if(nxt) delete nxt;
+// if(nxt) delete nxt;
+ FLEXT_ASSERT(nxt == NULL);
}
V pooldir::Clear(BL rec,BL dironly)
@@ -104,6 +107,7 @@ V pooldir::Clear(BL rec,BL dironly)
if(d) {
do {
d1 = d->nxt;
+ d->nxt = NULL;
delete d;
} while((d = d1) != NULL);
dirs[i].d = NULL;
@@ -117,6 +121,7 @@ V pooldir::Clear(BL rec,BL dironly)
if(v) {
do {
v1 = v->nxt;
+ v->nxt = NULL;
delete v;
} while((v = v1) != NULL);
vals[i].v = NULL;