diff options
author | Johnathan Corgan | 2012-04-15 15:26:30 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-04-15 15:26:30 -0700 |
commit | 04e2ebb979942cada74f10ea022342716c6851bf (patch) | |
tree | 423496316ccda8406f5db2dcaf6acf28d9b00c8f /gruel/src/lib/pmt/pmt.cc | |
parent | 25d687550a0322ffaf270f25faf2b4a78a97142c (diff) | |
parent | eba5deff498acba7fbc91c2bd00a2389d3fc0194 (diff) | |
download | gnuradio-04e2ebb979942cada74f10ea022342716c6851bf.tar.gz gnuradio-04e2ebb979942cada74f10ea022342716c6851bf.tar.bz2 gnuradio-04e2ebb979942cada74f10ea022342716c6851bf.zip |
Merge branch 'test/fix-pmt-deleter' into maint
Diffstat (limited to 'gruel/src/lib/pmt/pmt.cc')
-rw-r--r-- | gruel/src/lib/pmt/pmt.cc | 8 |
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() { |