fix for 45238, add kung-fu death grip on widget while we're processing the event. r=saari.

This commit is contained in:
pinkerton%netscape.com 2000-07-17 22:00:30 +00:00
Родитель 6d6fa85d8e
Коммит db28e724cb
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -1204,7 +1204,8 @@ PRBool nsMacEventHandler::HandleMouseDownEvent(EventRecord& aOSEvent)
if ( aOSEvent.modifiers & controlKey )
mouseButton = NS_MOUSE_RIGHT_BUTTON_DOWN;
ConvertOSEventToMouseEvent(aOSEvent, mouseEvent, mouseButton);
nsWindow* widgetHit = (nsWindow*)mouseEvent.widget;
nsCOMPtr<nsIWidget> kungFuDeathGrip ( mouseEvent.widget ); // ensure widget doesn't go away
nsWindow* widgetHit = NS_STATIC_CAST(nsWindow*, mouseEvent.widget); // while we're processing event
if (widgetHit)
{
// set the activation and focus on the widget hit, if it accepts it