From 9a6041c61f6de81e7d0e4ac56ed6c3838ee87ebc Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Thu, 23 Aug 2001 00:23:45 +0000 Subject: [PATCH] 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 --- widget/src/mac/nsMacMessageSink.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/widget/src/mac/nsMacMessageSink.cpp b/widget/src/mac/nsMacMessageSink.cpp index af7554ba6e8..d93501a78e2 100644 --- a/widget/src/mac/nsMacMessageSink.cpp +++ b/widget/src/mac/nsMacMessageSink.cpp @@ -38,7 +38,8 @@ NS_EXPORT PRBool nsMacMessageSink::DispatchOSEvent( PRBool eventHandled = PR_FALSE; nsMacWindow* raptorWindow = GetNSWindowFromMacWindow(aWindow); - + // prevent the window being deleted while we're in its methods + nsCOMPtr kungFuDeathGrip(NS_STATIC_CAST(nsIWidget*, raptorWindow)); if (raptorWindow) { eventHandled = raptorWindow->HandleOSEvent(anEvent); @@ -61,6 +62,8 @@ NS_EXPORT PRBool nsMacMessageSink::DispatchMenuCommand( PRBool eventHandled = PR_FALSE; nsMacWindow* raptorWindow = GetNSWindowFromMacWindow(aWindow); + // prevent the window being deleted while we're in its methods + nsCOMPtr kungFuDeathGrip(NS_STATIC_CAST(nsIWidget*, raptorWindow)); if (raptorWindow) { eventHandled = raptorWindow->HandleMenuCommand(anEvent, menuResult);