Don't compare the vtable pointers anymore when unrooting stuff

This commit is contained in:
Anthony Ramine 2020-03-06 18:55:35 +01:00
parent 05077d31c8
commit b5aa83f633
2 changed files with 9 additions and 2 deletions

View file

@ -262,7 +262,10 @@ impl RootCollection {
unsafe fn unroot(&self, object: *const dyn JSTraceable) {
debug_assert!(thread_state::get().is_script());
let roots = &mut *self.roots.get();
match roots.iter().rposition(|r| *r == object) {
match roots
.iter()
.rposition(|r| *r as *const () == object as *const ())
{
Some(idx) => {
roots.remove(idx);
},