diff --git a/fbreader/fbreader/zlibrary/core/src/util/shared_ptr.h b/fbreader/fbreader/zlibrary/core/src/util/shared_ptr.h index 6980967..221fce1 100644 --- a/fbreader/fbreader/zlibrary/core/src/util/shared_ptr.h +++ b/fbreader/fbreader/zlibrary/core/src/util/shared_ptr.h @@ -196,7 +196,7 @@ template inline unsigned int shared_ptr_storage::removeWeakReference() { #if FBREADER_USE_GNUC_SYNC_BUILTINS __sync_fetch_and_sub(&myWeakCounter, 1); - return __sync_add_and_fetch(&myTotalCount, 1); + return __sync_sub_and_fetch(&myTotalCount, 1); #else --myWeakCounter; return counter();