diff options
author | Bastien Nocera <hadess@hadess.net> | 2007-03-09 11:55:26 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2007-03-09 11:55:26 +0000 |
commit | 5bcd7be3a0e4a16637af9756d9ced56f6b5afa45 (patch) | |
tree | 630d2eacf173c6808679a7c3246e36bc3440a117 | |
parent | 789b43ff08eca27ea9fa980bbe504b4ed5c25338 (diff) | |
download | totem-5bcd7be3a0e4a16637af9756d9ced56f6b5afa45.tar.gz |
Patch from Alexander Sack <asac@jwsdot.com> to keep the dbus-glib library
2007-03-09 Bastien Nocera <hadess@hadess.net>
* browser-plugin/totemPlugin.cpp: Patch from
Alexander Sack <asac@jwsdot.com> to keep the dbus-glib
library in memory, to avoid crashes when switching themes
(Closes: #415389)
svn path=/branches/gnome-2-16/; revision=4099
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | browser-plugin/totemPlugin.cpp | 17 |
2 files changed, 19 insertions, 5 deletions
@@ -1,3 +1,10 @@ +2007-03-09 Bastien Nocera <hadess@hadess.net> + + * browser-plugin/totemPlugin.cpp: Patch from + Alexander Sack <asac@jwsdot.com> to keep the dbus-glib + library in memory, to avoid crashes when switching themes + (Closes: #415389) + 2007-03-08 Bastien Nocera <hadess@hadess.net> * 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 <sys/wait.h> #include <sys/poll.h> #include <string.h> +#include <dlfcn.h> #include <glib.h> #include <libgnomevfs/gnome-vfs-mime-handlers.h> @@ -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 |