[ooo-build-commit] patches/dev300
Michael Meeks
mmeeks at kemper.freedesktop.org
Fri Oct 23 04:20:22 PDT 2009
patches/dev300/apply | 2
patches/dev300/sfx2-qstart-nocrash.diff | 164 ++++++++++++++++++++++++++++
patches/dev300/sfx2-qstart-nocrashhack.diff | 43 -------
3 files changed, 165 insertions(+), 44 deletions(-)
New commits:
commit e89e6b264a91c9d11786fb56c99b3a057923f177
Author: Michael Meeks <michael.meeks at novell.com>
Date: Fri Oct 23 12:20:59 2009 +0100
Fix quick-starter crash on unload more elegantly.
* patches/dev300/apply:
* patches/dev300/sfx2-qstart-nocrash.diff:
* patches/dev300/sfx2-qstart-nocrashhack.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 1b2d670..0df961a 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3074,7 +3074,7 @@ slideshow-mute-sound.diff, thorsten
base64.diff, i#100620, hmth
# gtk quickstarter crashes on disable/exit
-sfx2-qstart-nocrashhack.diff, i#101245, pmladek
+sfx2-qstart-nocrash.diff, i#101245, michael
# Fix from Andre, allows to step back one animation effect
slideshow-effect-rewind.diff, i#48179, thorsten
diff --git a/patches/dev300/sfx2-qstart-nocrash.diff b/patches/dev300/sfx2-qstart-nocrash.diff
new file mode 100644
index 0000000..2920ded
--- /dev/null
+++ b/patches/dev300/sfx2-qstart-nocrash.diff
@@ -0,0 +1,164 @@
+--- sfx2/source/appl/shutdownicon.cxx
++++ sfx2/source/appl/shutdownicon.cxx
+@@ -69,6 +69,7 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #endif
++#include <vcl/timer.hxx>
+
+ #include "sfxresid.hxx"
+
+@@ -186,6 +187,23 @@
+ return true;
+ }
+
++class IdleUnloader : Timer
++{
++ ::osl::Module *m_pModule;
++public:
++ IdleUnloader (::osl::Module **pModule) :
++ m_pModule (*pModule)
++ {
++ *pModule = NULL;
++ Start();
++ }
++ virtual void Timeout()
++ {
++ delete m_pModule;
++ delete this;
++ }
++};
++
+ void ShutdownIcon::initSystray()
+ {
+ if (m_bInitialized)
+@@ -201,15 +221,15 @@
+ {
+ if (!m_bInitialized)
+ return;
++
+ if (m_pDeInitSystray)
+ m_pDeInitSystray();
+
+ m_bVeto = false;
+ m_pInitSystray = 0;
+ m_pDeInitSystray = 0;
+- if (m_pPlugin)
+- delete m_pPlugin;
+- m_pPlugin = 0;
++ new IdleUnloader (&m_pPlugin);
++
+ delete m_pFileDlg;
+ m_pFileDlg = NULL;
+ m_bInitialized = false;
+@@ -228,6 +249,7 @@
+ ShutdownIcon::~ShutdownIcon()
+ {
+ deInitSystray();
++ new IdleUnloader (&m_pPlugin);
+ }
+
+ // ---------------------------------------------------------------------------
+@@ -853,9 +884,11 @@
+ ::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
+ ::osl::File::remove( aShortcutUrl );
+ #ifdef UNX
+- ShutdownIcon *pIcon = getInstance();
+- if( pIcon )
+- pIcon->deInitSystray();
++ if (pShutdownIcon)
++ {
++ ShutdownIcon *pIcon = getInstance();
++ pIcon->deInitSystray();
++ }
+ #endif
+ }
+ #elif defined OS2
+
+--- libegg/source/eggtrayicon.c
++++ libegg/source/eggtrayicon.c
+@@ -76,6 +76,14 @@
+ static void egg_tray_icon_manager_window_destroyed (EggTrayIcon *icon);
+ #endif
+
++/*
++ * This is made somewhat more 'interesting' by the facts that:
++ * a) GTypePlugin is a foul & tangled mess
++ * b) We may have been unloaded, and left an invalid
++ * EggTrayIcon class lying around in the GType database,
++ * we could use GTypePlugin to fix this, but see a) -
++ * this is far easier and simpler.
++ */
+ GType
+ egg_tray_icon_get_type (void)
+ {
+@@ -88,18 +96,23 @@
+ sizeof (EggTrayIconClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+- (GClassInitFunc) egg_tray_icon_class_init,
++ (GClassInitFunc) NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (EggTrayIcon),
+ 0, /* n_preallocs */
+- (GInstanceInitFunc) egg_tray_icon_init,
++ (GInstanceInitFunc) NULL, /* instance_init */
+ NULL
+ };
+
+- our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);
++ our_type = g_type_from_name ("EggTrayIcon");
++ if (!our_type)
++ our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);
+ }
+
++ /* always overwrite the function pointers */
++ egg_tray_icon_class_init (g_type_class_ref (our_type));
++
+ return our_type;
+ }
+
+@@ -128,22 +141,15 @@
+
+ container_class->add = egg_tray_icon_add;
+
+- g_object_class_install_property (gobject_class,
+- PROP_ORIENTATION,
+- g_param_spec_enum ("orientation",
+- _("Orientation"),
+- _("The orientation of the tray."),
+- GTK_TYPE_ORIENTATION,
+- GTK_ORIENTATION_HORIZONTAL,
+- G_PARAM_READABLE));
+-
+-#if defined (GDK_WINDOWING_X11)
+- /* Nothing */
+-#elif defined (GDK_WINDOWING_WIN32)
+- g_warning ("Port eggtrayicon to Win32");
+-#else
+- g_warning ("Port eggtrayicon to this GTK+ backend");
+-#endif
++ if (!g_object_class_find_property (gobject_class, "orientation"))
++ g_object_class_install_property (gobject_class,
++ PROP_ORIENTATION,
++ g_param_spec_enum ("orientation",
++ "Orientation",
++ "The orientation of the tray.",
++ GTK_TYPE_ORIENTATION,
++ GTK_ORIENTATION_HORIZONTAL,
++ G_PARAM_READABLE));
+ }
+
+ static void
+@@ -471,7 +477,9 @@
+ EggTrayIcon*
+ egg_tray_icon_new (const gchar *name)
+ {
+- return g_object_new (EGG_TYPE_TRAY_ICON, "title", name, NULL);
++ EggTrayIcon *icon = g_object_new (EGG_TYPE_TRAY_ICON, "title", name, NULL);
++ egg_tray_icon_init (icon);
++ return icon;
+ }
+
+ guint
diff --git a/patches/dev300/sfx2-qstart-nocrashhack.diff b/patches/dev300/sfx2-qstart-nocrashhack.diff
deleted file mode 100644
index f8acbf2..0000000
--- a/patches/dev300/sfx2-qstart-nocrashhack.diff
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -ru sfx2/source/appl/shutdownicon.cxx sfx2/source/appl/shutdownicon.cxx
---- sfx2.orig/source/appl/shutdownicon.cxx 2009-04-21 12:57:08.000000000 +0100
-+++ sfx2/source/appl/shutdownicon.cxx 2009-04-21 15:26:25.000000000 +0100
-@@ -192,7 +192,9 @@
- return;
- m_bInitialized = true;
-
-- (void) LoadModule( &m_pPlugin, &m_pInitSystray, &m_pDeInitSystray );
-+ if (!m_pPlugin)
-+ (void) LoadModule( &m_pPlugin, &m_pInitSystray, &m_pDeInitSystray );
-+
- m_bVeto = true;
- m_pInitSystray();
- }
-@@ -201,15 +203,11 @@
- {
- if (!m_bInitialized)
- return;
-+
- if (m_pDeInitSystray)
- m_pDeInitSystray();
-
- m_bVeto = false;
-- m_pInitSystray = 0;
-- m_pDeInitSystray = 0;
-- if (m_pPlugin)
-- delete m_pPlugin;
-- m_pPlugin = 0;
- delete m_pFileDlg;
- m_pFileDlg = NULL;
- m_bInitialized = false;
-@@ -233,6 +231,11 @@
- ShutdownIcon::~ShutdownIcon()
- {
- deInitSystray();
-+ //Bustage on dlclosing when: no qstarter, start writer, enable, close writer, choose disable/quit
-+ //dlclose gets called and pulls .so from under hack-tower
-+#ifndef UNX
-+ delete m_pPlugin;
-+#endif
- }
-
- // ---------------------------------------------------------------------------
More information about the ooo-build-commit
mailing list