Advertisement
Guest User

Untitled

a guest
Apr 15th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. diff --git a/gruel/src/lib/pmt/pmt.cc b/gruel/src/lib/pmt/pmt.cc
  2. index a7e0fd1..04ab8cf 100644
  3. --- a/gruel/src/lib/pmt/pmt.cc
  4. +++ b/gruel/src/lib/pmt/pmt.cc
  5. @@ -58,7 +58,13 @@ pmt_base::operator delete(void *p, size_t size)
  6. #endif
  7.  
  8. void intrusive_ptr_add_ref(pmt_base* p) { ++(p->count_); }
  9. -void intrusive_ptr_release(pmt_base* p) { if (--(p->count_) == 0 ) p->deleter_(
  10. +void intrusive_ptr_release(pmt_base* p) {
  11. + if (--(p->count_) == 0 ){
  12. + //make a copy of deleter before we delete its container, p
  13. + boost::function<void(pmt_base *)> deleter = p->deleter_;
  14. + deleter(p);
  15. + }
  16. +}
  17.  
  18. pmt_base::~pmt_base()
  19. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement