Add a comment about `unsafe` operation
commit80c4d5971f9e592fdc7fbeb37e5bdae9f128e8f6
authorNick Fitzgerald <fitzgen@gmail.com>
dateTue 12 Feb 2019, 06:33 (8 years ago)
parent2cab2b9
src/vdom.rs+4
@@ -332,6 +332,10 @@ impl VdomInnerExclusive {
332332
333333 'outer1: for new_l in new {
334334 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.
335339 registry.add(new_l);
336340 }
337341 for old_l in old {