]> git.nihav.org Git - nihav.git/commitdiff
core/refs: fix drop condition
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 14 May 2019 13:10:23 +0000 (15:10 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 14 May 2019 13:10:23 +0000 (15:10 +0200)
nihav-core/src/refs.rs

index de1c4fc3b5f7809120bdce7b0e93a82105892287..023a2136ad99fdafebe5d653957eb372e2f22cae 100644 (file)
@@ -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)