aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flbind.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/flext/source/flbind.cpp')
-rw-r--r--externals/grill/flext/source/flbind.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/externals/grill/flext/source/flbind.cpp b/externals/grill/flext/source/flbind.cpp
index ff84e4ea..7611fc59 100644
--- a/externals/grill/flext/source/flbind.cpp
+++ b/externals/grill/flext/source/flbind.cpp
@@ -62,12 +62,17 @@ flext_base::BindItem::BindItem(bool (*f)(flext_base *,t_symbol *s,int,t_atom *,v
flext_base::BindItem::~BindItem()
{
- if(px) object_free(&px->obj);
+ if(px) {
+ FLEXT_ASSERT(!fun); // check if already unbound
+ object_free(&px->obj);
+ }
}
void flext_base::BindItem::Unbind(const t_symbol *tag)
{
if(px) {
+ FLEXT_ASSERT(fun);
+
#if FLEXT_SYS == FLEXT_SYS_PD
pd_unbind(&px->obj.ob_pd,const_cast<t_symbol *>(tag));
#elif FLEXT_SYS == FLEXT_SYS_MAX
@@ -78,6 +83,8 @@ void flext_base::BindItem::Unbind(const t_symbol *tag)
#else
# pragma warning("Not implemented")
#endif
+
+ fun = NULL;
}
}