From ac07e6a338f1dba0a4c5a5d044bb58b01e82a211 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 12 Oct 2001 05:23:47 +0000 Subject: [Hopefully really, finally fix #8615 and friends.] * main.c (no_views_left_cb): Invoke `e_shell_disconnect_db()' before unreffing the shell. * e-shell.c (e_shell_disconnect_db): New. (destroy): Call it instead of unreffing the db manually here. svn path=/trunk/; revision=13616 --- shell/main.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 2308862d4d..401a89d269 100644 --- a/shell/main.c +++ b/shell/main.c @@ -127,6 +127,29 @@ no_views_left_cb (EShell *shell, gpointer data) e_shell_unregister_all (shell); + /* FIXME: And this is another ugly hack. We have a strange race + condition that I cannot work around. What happens is that the + EShell object gets unreffed and its aggregate EActivityHandler gets + destroyed too. But for some reason, the EActivityHanlder GtkObject + gets freed, while its CORBA object counterpart is still an active + server. So there is a slight chance that we receive CORBA + invocation that act on an uninitialized object, and we crash. (See + #8615.) + + The CORBA invocation on the dead object only happens because we + ::unref the BonoboConf database server in the ::destroy method of + the shell. Since this is a CORBA call, it allows incoming CORBA + calls to happen -- and these get invoked on the partially + uninitialized object. + + Since I am not 100% sure what the reason for this half-stale object + is, I am just going to make sure that no CORBA ops happen in + ::destroy... And this is achieved by placing this call here. (If + the DB is disconnected, there will be no ::unref of it in + ::destroy.) */ + + e_shell_disconnect_db (shell); + bonobo_object_unref (BONOBO_OBJECT (shell)); if (quit_box != NULL) -- cgit v1.2.3