1
0
Fork 0
forked from wry/wry

all: clear more reference cycles at shutdown

This commit is contained in:
Julian Orth 2024-05-02 21:16:53 +02:00
parent 4d33dbf32f
commit 3473b89fb9
7 changed files with 76 additions and 9 deletions

View file

@ -12,6 +12,11 @@ pub struct OnChange<T> {
}
impl<T> OnChange<T> {
pub fn clear(&self) {
self.on_change.take();
self.events.take();
}
pub fn send_event(&self, event: T) {
self.events.push(event);
if let Some(cb) = self.on_change.get() {