on master help sign in
Add a comment about `unsafe` operation
80c4d59Nick Fitzgerald
src/vdom.rs+4
@@ -332,6 +332,10 @@ impl VdomInnerExclusive {
332
332
333 'outer1: for new_l in new {
333 'outer1: for new_l in new {
334 unsafe {
334 unsafe {
335+ // Safety relies on removing `new_l` from the registry manually
336+ // at the end of its lifetime. This happens when we invoke
337+ // `clear_active_listeners` at the start of a new rendering
338+ // phase.
335 registry.add(new_l);
339 registry.add(new_l);
336 }
340 }
337 for old_l in old {
341 for old_l in old {