Fix bug 96232, crash while typing if tooltip is showing. Add kung fu death grip on the nsMacWindow. r=pinkerton/brade, sr=brendan, a=drivers

This commit is contained in:
sfraser%netscape.com 2001-08-23 00:23:45 +00:00
Родитель 2ef6412172
Коммит 9a6041c61f
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -38,7 +38,8 @@ NS_EXPORT PRBool nsMacMessageSink::DispatchOSEvent(
PRBool eventHandled = PR_FALSE; PRBool eventHandled = PR_FALSE;
nsMacWindow* raptorWindow = GetNSWindowFromMacWindow(aWindow); nsMacWindow* raptorWindow = GetNSWindowFromMacWindow(aWindow);
// prevent the window being deleted while we're in its methods
nsCOMPtr<nsIWidget> kungFuDeathGrip(NS_STATIC_CAST(nsIWidget*, raptorWindow));
if (raptorWindow) if (raptorWindow)
{ {
eventHandled = raptorWindow->HandleOSEvent(anEvent); eventHandled = raptorWindow->HandleOSEvent(anEvent);
@ -61,6 +62,8 @@ NS_EXPORT PRBool nsMacMessageSink::DispatchMenuCommand(
PRBool eventHandled = PR_FALSE; PRBool eventHandled = PR_FALSE;
nsMacWindow* raptorWindow = GetNSWindowFromMacWindow(aWindow); nsMacWindow* raptorWindow = GetNSWindowFromMacWindow(aWindow);
// prevent the window being deleted while we're in its methods
nsCOMPtr<nsIWidget> kungFuDeathGrip(NS_STATIC_CAST(nsIWidget*, raptorWindow));
if (raptorWindow) if (raptorWindow)
{ {
eventHandled = raptorWindow->HandleMenuCommand(anEvent, menuResult); eventHandled = raptorWindow->HandleMenuCommand(anEvent, menuResult);