From 5bcd7be3a0e4a16637af9756d9ced56f6b5afa45 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 9 Mar 2007 11:55:26 +0000 Subject: Patch from Alexander Sack to keep the dbus-glib library 2007-03-09 Bastien Nocera * browser-plugin/totemPlugin.cpp: Patch from Alexander Sack to keep the dbus-glib library in memory, to avoid crashes when switching themes (Closes: #415389) svn path=/branches/gnome-2-16/; revision=4099 --- ChangeLog | 7 +++++++ browser-plugin/totemPlugin.cpp | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdddbdd48..76165b7ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-09 Bastien Nocera + + * browser-plugin/totemPlugin.cpp: Patch from + Alexander Sack to keep the dbus-glib + library in memory, to avoid crashes when switching themes + (Closes: #415389) + 2007-03-08 Bastien Nocera * src/backend/bacon-video-widget-xine.c: diff --git a/browser-plugin/totemPlugin.cpp b/browser-plugin/totemPlugin.cpp index 5b4f0b5b1..7c665edf2 100644 --- a/browser-plugin/totemPlugin.cpp +++ b/browser-plugin/totemPlugin.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -399,11 +400,6 @@ totem_plugin_new_instance (NPMIMEType mimetype, if (instance == NULL) return NPERR_INVALID_INSTANCE_ERROR; - /* Make sure the plugin stays resident to avoid crashers when - * reloading the GObject types */ - mozilla_functions.setvalue (instance, - NPPVpluginKeepLibraryInMemory, (void *)TRUE); - instance->pdata = mozilla_functions.memalloc(sizeof(totemPlugin)); plugin = (totemPlugin *) instance->pdata; @@ -994,6 +990,17 @@ NP_Initialize (NPNetscapeFuncs * moz_funcs, if (plugin_funcs->size < sizeof (NPPluginFuncs)) return NPERR_INVALID_FUNCTABLE_ERROR; + /* we want to open libdbus-glib-1.so.2 in such a way + * in such a way that it becomes permanentely resident */ + void *handle; + handle = dlopen ("libdbus-glib-1.so.2", RTLD_NOW | RTLD_NODELETE); + if (!handle) { + fprintf (stderr, "%s\n", dlerror()); + return NPERR_MODULE_LOAD_FAILED_ERROR; + } + /* RTLD_NODELETE allows us to close right away ... */ + dlclose(handle); + /* * Copy all of the fields of the Mozilla function table into our * copy so we can call back into Mozilla later. Note that we need -- cgit v1.2.1