Fix a small leak of an nsBaseWidget (when clicking the mouse on the Start Mozilla button in the profile manager, and probably some other cases).

r=pavlov
This commit is contained in:
dbaron%fas.harvard.edu 2000-02-13 14:59:55 +00:00
Родитель b4576aa5f8
Коммит 2c48f94bb4
1 изменённых файлов: 7 добавлений и 3 удалений

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

@ -2073,9 +2073,13 @@ nsWidget::OnButtonReleaseSignal(GdkEventButton * aGdkButtonEvent)
event.point.y = nscoord(sButtonMotionWidgetY + diffY);
}
NS_ADDREF(event.widget);
NS_STATIC_CAST(nsWidget*,event.widget)->DispatchMouseEvent(event);
NS_IF_RELEASE(event.widget);
// event.widget can get set to null when calling DispatchMouseEvent,
// so to release it we must make a copy
nsWidget* theWidget = NS_STATIC_CAST(nsWidget*,event.widget);
NS_ADDREF(theWidget);
theWidget->DispatchMouseEvent(event);
NS_IF_RELEASE(theWidget);
if (sButtonMotionTarget)