Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit b9f423a

Browse files
author
Matteo Biggio
committed
glib: use increment_strong_count instead of ManuallyDrop
1 parent 07516d5 commit b9f423a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

glib/src/subclass/shared.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ where
2525
type InnerType = T;
2626

2727
unsafe fn ref_(this: *const Self::InnerType) -> *const Self::InnerType {
28-
use std::mem::ManuallyDrop;
29-
let this_rc = ManuallyDrop::new(std::sync::Arc::from_raw(this));
30-
std::sync::Arc::into_raw(ManuallyDrop::take(&mut this_rc.clone()))
28+
std::sync::Arc::increment_strong_count(this);
29+
this
3130
}
3231

3332
unsafe fn into_raw(self) -> *const Self::InnerType {

0 commit comments

Comments
 (0)