Bug 555018: Initialize nsChildView plugin ports. r=roc a=dveditz
authorJosh Aas <joshmoz@gmail.com>
Thu, 15 Sep 2011 14:49:39 -0400
changeset 35189 3fb441425998de9665ad96e6771a4277d73e810b
parent 35188 c7190956f9708551ac21acebf6c08a01a2a9c500
child 35190 0fd04c75cfb36201281f81f934e7dda29530b8ce
push id1976
push userjosh@mozilla.com
push dateThu, 15 Sep 2011 18:50:47 +0000
reviewersroc, dveditz
bugs555018
milestone1.9.2.23pre
Bug 555018: Initialize nsChildView plugin ports. r=roc a=dveditz
widget/src/cocoa/nsChildView.h
widget/src/cocoa/nsChildView.mm
--- a/widget/src/cocoa/nsChildView.h
+++ b/widget/src/cocoa/nsChildView.h
@@ -62,17 +62,16 @@
 
 #include "nsplugindefs.h"
 
 #import <Carbon/Carbon.h>
 #import <Cocoa/Cocoa.h>
 
 class gfxASurface;
 class nsChildView;
-union nsPluginPort;
 class nsITimer;
 
 enum {
   // Currently focused ChildView (while this TSM document is active).
   // Transient (only set while TSMProcessRawKeyEvent() is processing a key
   // event), and the ChildView will be retained and released around the call
   // to TSMProcessRawKeyEvent() -- so it can be weak.
   kFocusedChildViewTSMDocPropertyTag  = 'GKFV', // type ChildView* [WEAK]
--- a/widget/src/cocoa/nsChildView.mm
+++ b/widget/src/cocoa/nsChildView.mm
@@ -515,16 +515,18 @@ nsChildView::nsChildView() : nsBaseWidge
   if (!sCocoaLog) {
     sCocoaLog = PR_NewLogModule("nsCocoaWidgets");
 #ifdef DEBUG
     DebugPrintAllKeyboardLayouts();
 #endif // DEBUG
   }
 #endif
 
+  memset(&mPluginPort, 0, sizeof(mPluginPort));
+
   SetBackgroundColor(NS_RGB(255, 255, 255));
   SetForegroundColor(NS_RGB(0, 0, 0));
 
   if (nsToolkit::OnLeopardOrLater() && !Leopard_TISCopyCurrentKeyboardLayoutInputSource) {
     // This libary would already be open for LMGetKbdType (and probably other
     // symbols), so merely using RTLD_DEFAULT in dlsym would be sufficient,
     // but man dlsym says: "all mach-o images in the process (except ...) are
     // searched in the order they were loaded.  This can be a costly search