aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-core/src
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2019-05-14 15:10:23 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2019-05-14 15:10:23 +0200
commit3485eca4fe0f67b0d204f2ce63afff0fcacb9c94 (patch)
tree354e9687b756056e6fcedb83615d959823a4735c /nihav-core/src
parentc2a4fa57b414ec496948a1812344a60bd72e1845 (diff)
downloadnihav-3485eca4fe0f67b0d204f2ce63afff0fcacb9c94.tar.gz
core/refs: fix drop condition
Diffstat (limited to 'nihav-core/src')
-rw-r--r--nihav-core/src/refs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/nihav-core/src/refs.rs b/nihav-core/src/refs.rs
index de1c4fc..023a213 100644
--- a/nihav-core/src/refs.rs
+++ b/nihav-core/src/refs.rs
@@ -18,7 +18,7 @@ impl<T> NABufferData<T> {
obj.refs.fetch_add(1, Ordering::SeqCst);
}
fn dec_refs(obj: &mut Self) -> bool {
- obj.refs.fetch_sub(1, Ordering::SeqCst) == 0
+ obj.refs.fetch_sub(1, Ordering::SeqCst) == 1
}
fn get_num_refs(obj: &Self) -> usize {
obj.refs.load(Ordering::Relaxed)