From 5cda370a2808e9f9c4cc9033d454048ea52ce72e Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Fri, 31 Mar 2000 21:43:34 +0000 Subject: [PATCH] fix for bug #34094: turned on USE_TLS_FOR_TOOLKIT, so only 1 per thread will be used, changed nsAppShell::Create(int* argc, char ** argv) to use NS_GetCurrentToolkit(). This is a total blocker for Mac. r=sfraser git-svn-id: svn://10.0.0.236/trunk@64798 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/macbuild/Widget.prefix | 4 +++- mozilla/widget/macbuild/WidgetDebug.prefix | 4 +++- mozilla/widget/src/mac/nsAppShell.cpp | 8 ++++++-- mozilla/widget/src/mac/nsAppShell.h | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/mozilla/widget/macbuild/Widget.prefix b/mozilla/widget/macbuild/Widget.prefix index 7e41bb923b5..1264cc03657 100644 --- a/mozilla/widget/macbuild/Widget.prefix +++ b/mozilla/widget/macbuild/Widget.prefix @@ -8,4 +8,6 @@ #include #include -#include \ No newline at end of file +#include + +#define USE_TLS_FOR_TOOLKIT 1 diff --git a/mozilla/widget/macbuild/WidgetDebug.prefix b/mozilla/widget/macbuild/WidgetDebug.prefix index 4dd7c796583..4a8671ab071 100644 --- a/mozilla/widget/macbuild/WidgetDebug.prefix +++ b/mozilla/widget/macbuild/WidgetDebug.prefix @@ -8,4 +8,6 @@ #include #include -#include \ No newline at end of file +#include + +#define USE_TLS_FOR_TOOLKIT 1 diff --git a/mozilla/widget/src/mac/nsAppShell.cpp b/mozilla/widget/src/mac/nsAppShell.cpp index 34621298078..251e2d21eaf 100644 --- a/mozilla/widget/src/mac/nsAppShell.cpp +++ b/mozilla/widget/src/mac/nsAppShell.cpp @@ -77,9 +77,13 @@ NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListe NS_IMETHODIMP nsAppShell::Create(int* argc, char ** argv) { - mToolKit = auto_ptr( new nsToolkit() ); + nsresult rv; + rv = NS_GetCurrentToolkit(getter_AddRefs(mToolkit)); + if (NS_FAILED(rv)) + return rv; mMacSink = auto_ptr( new nsMacMessageSink() ); - mMacPump = auto_ptr( new nsMacMessagePump(mToolKit.get(), mMacSink.get()) ); + nsIToolkit* toolkit = mToolkit.get(); + mMacPump = auto_ptr( new nsMacMessagePump(static_cast(toolkit), mMacSink.get()) ); return NS_OK; } diff --git a/mozilla/widget/src/mac/nsAppShell.h b/mozilla/widget/src/mac/nsAppShell.h index 34ef88a10ef..f5284669f4e 100644 --- a/mozilla/widget/src/mac/nsAppShell.h +++ b/mozilla/widget/src/mac/nsAppShell.h @@ -33,12 +33,13 @@ #define nsAppShell_h__ #include "nsIAppShell.h" +#include "nsCOMPtr.h" #include class nsMacMessagePump; class nsMacMessageSink; -class nsToolkit; +class nsIToolkit; class nsAppShell : public nsIAppShell @@ -52,7 +53,7 @@ class nsAppShell : public nsIAppShell private: nsDispatchListener *mDispatchListener; // note: we don't own this, but it can be NULL - auto_ptr mToolKit; + nsCOMPtr mToolkit; auto_ptr mMacPump; auto_ptr mMacSink; //€€€ this will be COM, so use scc's COM_auto_ptr PRBool mExitCalled;