Skip to content

Commit

Permalink
glib: Deprecate SendWeakRef::new() because implementation is unsound
Browse files Browse the repository at this point in the history
  • Loading branch information
quo committed Jan 7, 2025
1 parent 96e4705 commit f58de6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions glib/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3575,6 +3575,7 @@ pub struct SendWeakRef<T: ObjectType>(WeakRef<T>, Option<usize>);

impl<T: ObjectType> SendWeakRef<T> {
#[inline]
#[deprecated = "Use from() instead. See https://github.com/gtk-rs/gtk-rs-core/issues/1617"]
pub fn new() -> SendWeakRef<T> {
SendWeakRef(WeakRef::new(), None)
}
Expand Down Expand Up @@ -3615,6 +3616,7 @@ impl<T: ObjectType> Clone for SendWeakRef<T> {
impl<T: ObjectType> Default for SendWeakRef<T> {
#[inline]
fn default() -> Self {
#[allow(deprecated)]
Self::new()
}
}
Expand Down

0 comments on commit f58de6c

Please sign in to comment.