Skip to content

Commit 41c8527

Browse files
stormshield-damienddjc
authored andcommitted
quinn: fix ref count logic for ConnectionRef and EndpointRef
1 parent 73ea1dd commit 41c8527

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

quinn/src/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ impl Clone for ConnectionRef {
928928

929929
impl Drop for ConnectionRef {
930930
fn drop(&mut self) {
931-
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 0 {
931+
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 1 {
932932
return;
933933
}
934934

quinn/src/endpoint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ impl Clone for EndpointRef {
717717

718718
impl Drop for EndpointRef {
719719
fn drop(&mut self) {
720-
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 0 {
720+
if self.shared.ref_count.fetch_sub(1, Ordering::Relaxed) > 1 {
721721
return;
722722
}
723723

0 commit comments

Comments
 (0)