mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-16 16:25:08 +00:00
quinn: fix ref count logic for ConnectionRef and EndpointRef
This commit is contained in:
committed by
Benjamin Saunders
parent
4b796fa881
commit
37625fe2d8
@@ -932,7 +932,7 @@ impl Clone for ConnectionRef {
|
||||
|
||||
impl Drop for ConnectionRef {
|
||||
fn drop(&mut self) {
|
||||
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 0 {
|
||||
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 1 {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -784,7 +784,7 @@ impl Clone for EndpointRef {
|
||||
|
||||
impl Drop for EndpointRef {
|
||||
fn drop(&mut self) {
|
||||
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 0 {
|
||||
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 1 {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user