Bug 466433 - Crash [@ CallQueryInterface<nsIFrame,nsIScrollableViewProvider>] with MozMousePixelScroll event and removing window, r+sr=roc
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 03 Dec 2008 12:33:31 +0200
changeset 22220 935602ff18caccac85de8d7e9a97878ba9b891cb
parent 22219 d000c016b3233bcd6ac67c6939ba848c668a336c
child 22221 cee9bd12306a5a730795798905dbb4821b5da793
push idunknown
push userunknown
push dateunknown
bugs466433
milestone1.9.2a1pre
Bug 466433 - Crash [@ CallQueryInterface<nsIFrame,nsIScrollableViewProvider>] with MozMousePixelScroll event and removing window, r+sr=roc
content/events/src/nsEventStateManager.cpp
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -2909,17 +2909,19 @@ nsEventStateManager::PostHandleEvent(nsP
         if (msEvent->scrollFlags & nsMouseScrollEvent::kIsHorizontal) {
           mLastLineScrollConsumedX = (nsEventStatus_eConsumeNoDefault == *aStatus);
         } else if (msEvent->scrollFlags & nsMouseScrollEvent::kIsVertical) {
           mLastLineScrollConsumedY = (nsEventStatus_eConsumeNoDefault == *aStatus);
         }
         if (!(msEvent->scrollFlags & nsMouseScrollEvent::kHasPixels)) {
           // No generated pixel scroll event will follow.
           // Create and send a pixel scroll DOM event now.
+          nsWeakFrame weakFrame(aTargetFrame);
           SendPixelScrollEvent(aTargetFrame, msEvent, presContext, aStatus);
+          NS_ENSURE_STATE(weakFrame.IsAlive());
         }
       }
 
       if (*aStatus != nsEventStatus_eConsumeNoDefault) {
         // Build the preference keys, based on the event properties.
         NS_NAMED_LITERAL_CSTRING(actionslot,      ".action");
         NS_NAMED_LITERAL_CSTRING(sysnumlinesslot, ".sysnumlines");