diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-15 16:26:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-15 16:26:03 +0200 |
commit | cdb8876ff271ce235c2f02a917a0c79a37d5c4b0 (patch) | |
tree | c065a0b7bb79caf81baad1593787bca6efe46d52 | |
parent | 31633fe1b9ad734434dd8c0121fe86233c15a142 (diff) |
Change shared_ptr callback interface to work in mt-environment
-rw-r--r-- | odb/details/shared-ptr/base.cxx | 5 | ||||
-rw-r--r-- | 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: |