Chromium Code Reviews
DescriptionMy Friday fix for some stack trashing introduced some heap trashing!
The tests create PageInterstitial objects which are self-owned (they delete themselves when hidden).
The tests test whether the PageInterstitial instance has been deleted by passing a local variable boolean to its constructor that the InterstitialPage sets to true when deleted.
In the stack trashing case, in one of the test the interstitial was deleted from the TearDown() method, so outside of the scope of the test. The interstitial was still accessing the local variable from the test scope, trashing the stack.
My previous fix introduced a state guard class allocated on the stack that would notify the InterstitialPage when deleted so it would clear any reference to the local vars, which fixed the stack trashing.
But this created a new problem: when the interstitial is deleted in the scope of the unit tests, the state guard object still holds a reference to the now deleted interstitial and calls a method on it when itself deleted.
This CL ensures the state guard class does not access any deleted interstitial.
BUG=5789
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=7384
Patch Set 1 #Patch Set 2 : '' #Messages
Total messages: 2 (0 generated)
|