From cdb8876ff271ce235c2f02a917a0c79a37d5c4b0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Mar 2011 16:26:03 +0200 Subject: Change shared_ptr callback interface to work in mt-environment --- odb/details/shared-ptr/base.cxx | 5 +---- odb/details/shared-ptr/base.hxx | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/odb/details/shared-ptr/base.cxx b/odb/details/shared-ptr/base.cxx index 254ba1e..3331db7 100644 --- a/odb/details/shared-ptr/base.cxx +++ b/odb/details/shared-ptr/base.cxx @@ -26,10 +26,7 @@ namespace odb bool r (--counter_ == 0); if (r) - { - callback_->zero_counter (callback_->arg); - r = (counter_ == 0); - } + r = callback_->zero_counter (callback_->arg); return r; } diff --git a/odb/details/shared-ptr/base.hxx b/odb/details/shared-ptr/base.hxx index e75fb4a..7cf44da 100644 --- a/odb/details/shared-ptr/base.hxx +++ b/odb/details/shared-ptr/base.hxx @@ -80,7 +80,10 @@ namespace odb struct refcount_callback { void* arg; - void (*zero_counter) (void*); + + // Return true if the object should be deleted, false otherwise. + // + bool (*zero_counter) (void*); }; private: -- cgit v1.1