Lock the context when dropping nodes

This commit is contained in:
Martin Dahl 2020-10-14 23:50:41 +02:00
parent 4ac10c96db
commit e5a17ee232
1 changed files with 3 additions and 0 deletions

View File

@ -1209,6 +1209,9 @@ where
impl Drop for Node {
fn drop(&mut self) {
// fini functions are not thread safe so lock the context.
let _ctx_handle = self.context.context_handle.lock().unwrap();
for s in &mut self.subs {
s.destroy(&mut self.node_handle);
}