This commit is contained in:
Erica Z 2024-11-03 19:08:58 +01:00
parent 99d31fb28f
commit 7da4c6cea3
2 changed files with 4 additions and 21 deletions

View file

@ -101,27 +101,16 @@ impl<E, T> SignalEmitter<E, T> {
.expect("tried to re-emit signal during emission"); .expect("tried to re-emit signal during emission");
handlers.append(self.just_connected.borrow_mut().as_mut()); handlers.append(self.just_connected.borrow_mut().as_mut());
if handlers.is_empty() {
return;
}
let mut i = 0; let mut i = 0;
let mut skip = 0; let mut skip = 0;
loop { // FIXME: does not preserve ordering
if handlers[i + skip](emitter, f()) { while i < handlers.len() {
if handlers[i](emitter, f()) {
i += 1; i += 1;
} else { } else {
skip += 1; drop(handlers.swap_remove(i));
} }
if i + skip == handlers.len() {
break;
}
handlers.swap(i, i + skip);
} }
handlers.truncate(i);
} }
} }

View file

@ -165,12 +165,6 @@ mod imp {
false false
} }
} }
impl Drop for Song {
fn drop(&mut self) {
println!("dropping AudreyUiPlayQueueSong");
}
}
} }
use crate::playbin::Song as PlaybinSong; use crate::playbin::Song as PlaybinSong;