Bug 486940 - fix crash in gtk_xtbin_new; r=karlt, sr=roc
authorArpad Borsos <arpad.borsos@googlemail.com>
Mon, 06 Apr 2009 13:30:55 +0200
changeset 27011 d056669074c7bd63622d630c9123c861be4a5c27
parent 27010 b5f6a4b00c7f416913d68fa9f9170e53dfdb2842
child 27022 57213af4a45dc2318428b120934ad924ac465a43
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, roc
bugs486940
milestone1.9.2a1pre
Bug 486940 - fix crash in gtk_xtbin_new; r=karlt, sr=roc
modules/plugin/base/src/nsNPAPIPlugin.cpp
widget/src/gtkxtbin/gtk2xtbin.c
widget/src/gtkxtbin/gtk2xtbin.h
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -1892,17 +1892,17 @@ NPError NP_CALLBACK
         return NPERR_NO_ERROR;
       }
     }
     // adobe nppdf calls XtGetApplicationNameAndClass(display,
     // &instance, &class) we have to init Xt toolkit before get
     // XtDisplay just call gtk_xtbin_new(w,0) once
     static GtkWidget *gtkXtBinHolder = 0;
     if (!gtkXtBinHolder) {
-      gtkXtBinHolder = gtk_xtbin_new((GdkWindow*)GDK_ROOT_WINDOW(),0);
+      gtkXtBinHolder = gtk_xtbin_new(gdk_get_default_root_window(),0);
       // it crashes on destroy, let it leak
       // gtk_widget_destroy(gtkXtBinHolder);
     }
     (*(Display **)result) =  GTK_XTBIN(gtkXtBinHolder)->xtdisplay;
     return NPERR_NO_ERROR;
 #endif
     return NPERR_GENERIC_ERROR;
   }
--- a/widget/src/gtkxtbin/gtk2xtbin.c
+++ b/widget/src/gtkxtbin/gtk2xtbin.c
@@ -236,17 +236,17 @@ gtk_xtbin_get_type (void)
 }
 
 static void
 gtk_xtbin_class_init (GtkXtBinClass *klass)
 {
   GtkWidgetClass *widget_class;
   GtkObjectClass *object_class;
 
-  parent_class = g_type_class_ref (GTK_TYPE_SOCKET);
+  parent_class = g_type_class_peek_parent(klass);
 
   widget_class = GTK_WIDGET_CLASS (klass);
   widget_class->realize = gtk_xtbin_realize;
   widget_class->unrealize = gtk_xtbin_unrealize;
 
   object_class = GTK_OBJECT_CLASS (klass);
   object_class->destroy = gtk_xtbin_destroy;
 }
--- a/widget/src/gtkxtbin/gtk2xtbin.h
+++ b/widget/src/gtkxtbin/gtk2xtbin.h
@@ -92,17 +92,17 @@ struct _GtkXtBin
   Window         xtwindow;         /* Xt Toolkit XWindow */
   gint           x, y;
   gint           width, height;
   XtClient	 xtclient;         /* Xt Client for XEmbed */
 };
   
 struct _GtkXtBinClass
 {
-  GtkSocketClass widget_class;
+  GtkSocketClass parent_class;
 };
 
 GTKXTBIN_API(GType)       gtk_xtbin_get_type (void);
 GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f);
 GTKXTBIN_API(void)        gtk_xtbin_set_position (GtkXtBin *xtbin,
                                                   gint       x,
                                                   gint       y);
 GTKXTBIN_API(void)       gtk_xtbin_resize (GtkWidget *widget,