summaryrefslogtreecommitdiff
path: root/gruel/src/lib/pmt/pmt.cc
diff options
context:
space:
mode:
authorJohnathan Corgan2012-04-15 09:06:29 -0700
committerJohnathan Corgan2012-04-15 09:06:29 -0700
commiteba5deff498acba7fbc91c2bd00a2389d3fc0194 (patch)
tree7af3c7e948beb8379c77e2a416fa90f9d9109de1 /gruel/src/lib/pmt/pmt.cc
parenteb7b7932e7d2df651f00553561b66f0337f0bede (diff)
downloadgnuradio-eba5deff498acba7fbc91c2bd00a2389d3fc0194.tar.gz
gnuradio-eba5deff498acba7fbc91c2bd00a2389d3fc0194.tar.bz2
gnuradio-eba5deff498acba7fbc91c2bd00a2389d3fc0194.zip
pmt: fix segfault in deleter
Diffstat (limited to 'gruel/src/lib/pmt/pmt.cc')
-rw-r--r--gruel/src/lib/pmt/pmt.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gruel/src/lib/pmt/pmt.cc b/gruel/src/lib/pmt/pmt.cc
index 57b66b1a4..c100611be 100644
--- a/gruel/src/lib/pmt/pmt.cc
+++ b/gruel/src/lib/pmt/pmt.cc
@@ -58,7 +58,13 @@ pmt_base::operator delete(void *p, size_t size)
#endif
void intrusive_ptr_add_ref(pmt_base* p) { ++(p->count_); }
-void intrusive_ptr_release(pmt_base* p) { if (--(p->count_) == 0 ) p->deleter_(p); }
+void intrusive_ptr_release(pmt_base* p) {
+ if (--(p->count_) == 0 ){
+ //make a copy of deleter before we delete its container, p
+ boost::function<void(pmt_base *)> deleter = p->deleter_;
+ deleter(p);
+ }
+}
pmt_base::~pmt_base()
{