mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Make DomRoot::new unsafe
This commit is contained in:
parent
3dbb97922d
commit
1ff6c4f9aa
3 changed files with 7 additions and 6 deletions
|
@ -86,7 +86,9 @@ impl<T: WeakReferenceable> WeakRef<T> {
|
|||
|
||||
/// DomRoot a weak reference. Returns `None` if the object was already collected.
|
||||
pub fn root(&self) -> Option<DomRoot<T>> {
|
||||
unsafe { &*self.ptr.get() }.value.get().map(DomRoot::new)
|
||||
unsafe { &*self.ptr.get() }.value.get().map(|ptr| unsafe {
|
||||
DomRoot::from_ref(&*ptr.get())
|
||||
})
|
||||
}
|
||||
|
||||
/// Return whether the weakly-referenced object is still alive.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue