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

Commit 3c24a50

Browse files
author
Matteo Biggio
committed
glib: use increment_strong_count instead of ManuallyDrop
1 parent 2ac1aba commit 3c24a50

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::rc::Rc::from_raw(this));
30-
std::rc::Rc::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)