Skip to content

Commit 2376022

Browse files
authored
Merge pull request #1622 from quo/pr-sendweakref-0.20
glib: Deprecate SendWeakRef::new() because implementation is unsound
2 parents 96e4705 + f58de6c commit 2376022

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

glib/src/object.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3575,6 +3575,7 @@ pub struct SendWeakRef<T: ObjectType>(WeakRef<T>, Option<usize>);
35753575

35763576
impl<T: ObjectType> SendWeakRef<T> {
35773577
#[inline]
3578+
#[deprecated = "Use from() instead. See https://github.com/gtk-rs/gtk-rs-core/issues/1617"]
35783579
pub fn new() -> SendWeakRef<T> {
35793580
SendWeakRef(WeakRef::new(), None)
35803581
}
@@ -3615,6 +3616,7 @@ impl<T: ObjectType> Clone for SendWeakRef<T> {
36153616
impl<T: ObjectType> Default for SendWeakRef<T> {
36163617
#[inline]
36173618
fn default() -> Self {
3619+
#[allow(deprecated)]
36183620
Self::new()
36193621
}
36203622
}

0 commit comments

Comments
 (0)