Skip to content

Commit

Permalink
Bug 1162789 - Add a comment explaining why mForm is not set to null d…
Browse files Browse the repository at this point in the history
…uring unlink

Comment-only, landed on a CLOSED TREE, DONTBUILD
  • Loading branch information
ehsan committed May 8, 2015
1 parent 21ce8b6 commit 15c042b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dom/html/HTMLFormControlsCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ HTMLFormControlsCollection::FlushPendingNotifications()
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLFormControlsCollection)

NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(HTMLFormControlsCollection)
// Note: We intentionally don't set tmp->mForm to nullptr here, since doing
// so may result in crashes because of inconsistent null-checking after the
// object gets unlinked.
tmp->Clear();
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
Expand Down

0 comments on commit 15c042b

Please sign in to comment.