aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-shell-component-client.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-07-28 01:47:19 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-07-28 01:47:19 +0800
commitc3ccc6c5476928a2581888aaca63fa289f5f9f37 (patch)
tree2d3e89dd8b30f8372c6e2feaa386a7b562e95501 /shell/evolution-shell-component-client.c
parent1f5b5429ebefd67bc0449f0b48670db427975156 (diff)
downloadgsoc2013-evolution-c3ccc6c5476928a2581888aaca63fa289f5f9f37.tar.gz
gsoc2013-evolution-c3ccc6c5476928a2581888aaca63fa289f5f9f37.tar.zst
gsoc2013-evolution-c3ccc6c5476928a2581888aaca63fa289f5f9f37.zip
Remove the source for the timeout *before* invoking the CORBA method, as
* evolution-activity-client.c (impl_destroy): Remove the source for the timeout *before* invoking the CORBA method, as we might get the timeout callback while invoking the CORBA method, thus screwing things up. * evolution-shell-component-client.c (destroy_listener_interface): New helper function. (dispatch_callback): Use it. (impl_destroy): Call it when destroying the listener interface instead of just freeing the servant. svn path=/trunk/; revision=11452
Diffstat (limited to 'shell/evolution-shell-component-client.c')
-rw-r--r--shell/evolution-shell-component-client.c101
1 files changed, 55 insertions, 46 deletions
diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c
index 47059377d0..8d41f20785 100644
--- a/shell/evolution-shell-component-client.c
+++ b/shell/evolution-shell-component-client.c
@@ -111,6 +111,8 @@ static POA_GNOME_Evolution_ShellComponentListener__vepv ShellComponentListener_v
static gboolean ShellComponentListener_vepv_initialized = FALSE;
static void ShellComponentListener_vepv_initialize (void);
+static void dispatch_callback (EvolutionShellComponentClient *shell_component_client,
+ EvolutionShellComponentResult result);
struct _ShellComponentListenerServant {
POA_GNOME_Evolution_ShellComponentListener servant;
@@ -172,48 +174,6 @@ result_from_async_corba_result (GNOME_Evolution_ShellComponentListener_Result as
}
static void
-dispatch_callback (EvolutionShellComponentClient *shell_component_client,
- EvolutionShellComponentResult result)
-{
- EvolutionShellComponentClientPrivate *priv;
- EvolutionShellComponentClientCallback callback;
- PortableServer_ObjectId *oid;
- void *callback_data;
- CORBA_Environment ev;
-
- priv = shell_component_client->priv;
-
- g_return_if_fail (priv->callback != NULL);
- g_return_if_fail (priv->listener_servant != NULL);
-
- /* Notice that we destroy the interface and reset the callback information before
- dispatching the callback so that the callback can generate another request. */
-
- CORBA_exception_init (&ev);
-
- oid = PortableServer_POA_servant_to_id (bonobo_poa (), priv->listener_servant, &ev);
- PortableServer_POA_deactivate_object (bonobo_poa (), oid, &ev);
- POA_GNOME_Evolution_ShellComponentListener__fini (priv->listener_servant, &ev);
- CORBA_free (oid);
-
- CORBA_Object_release (priv->listener_interface, &ev);
- free_ShellComponentListener_servant (priv->listener_servant);
-
- CORBA_exception_free (&ev);
-
- priv->listener_servant = NULL;
- priv->listener_interface = CORBA_OBJECT_NIL;
-
- callback = priv->callback;
- callback_data = priv->callback_data;
-
- priv->callback = NULL;
- priv->callback_data = NULL;
-
- (* callback) (shell_component_client, result, callback_data);
-}
-
-static void
impl_ShellComponentListener_report_result (PortableServer_Servant servant,
const GNOME_Evolution_ShellComponentListener_Result result,
CORBA_Environment *ev)
@@ -273,6 +233,57 @@ create_listener_interface (EvolutionShellComponentClient *shell_component_client
priv->listener_interface = corba_interface;
}
+static void
+destroy_listener_interface (EvolutionShellComponentClient *client)
+{
+ EvolutionShellComponentClientPrivate *priv;
+ CORBA_Environment ev;
+ PortableServer_ObjectId *oid;
+
+ priv = client->priv;
+ CORBA_exception_init (&ev);
+
+ oid = PortableServer_POA_servant_to_id (bonobo_poa (), priv->listener_servant, &ev);
+ PortableServer_POA_deactivate_object (bonobo_poa (), oid, &ev);
+ POA_GNOME_Evolution_ShellComponentListener__fini (priv->listener_servant, &ev);
+ CORBA_free (oid);
+
+ CORBA_Object_release (priv->listener_interface, &ev);
+ free_ShellComponentListener_servant (priv->listener_servant);
+
+ CORBA_exception_free (&ev);
+}
+
+static void
+dispatch_callback (EvolutionShellComponentClient *shell_component_client,
+ EvolutionShellComponentResult result)
+{
+ EvolutionShellComponentClientPrivate *priv;
+ EvolutionShellComponentClientCallback callback;
+ void *callback_data;
+
+ priv = shell_component_client->priv;
+
+ g_return_if_fail (priv->callback != NULL);
+ g_return_if_fail (priv->listener_servant != NULL);
+
+ /* Notice that we destroy the interface and reset the callback information before
+ dispatching the callback so that the callback can generate another request. */
+
+ destroy_listener_interface (shell_component_client);
+
+ priv->listener_servant = NULL;
+ priv->listener_interface = CORBA_OBJECT_NIL;
+
+ callback = priv->callback;
+ callback_data = priv->callback_data;
+
+ priv->callback = NULL;
+ priv->callback_data = NULL;
+
+ (* callback) (shell_component_client, result, callback_data);
+}
+
/* GtkObject methods. */
@@ -306,10 +317,8 @@ impl_destroy (GtkObject *object)
CORBA_Object_release (priv->offline_interface, &ev);
}
- if (priv->listener_interface != CORBA_OBJECT_NIL) {
- CORBA_Object_release (priv->listener_interface, &ev);
- free_ShellComponentListener_servant (priv->listener_servant);
- }
+ if (priv->listener_interface != CORBA_OBJECT_NIL)
+ destroy_listener_interface (shell_component_client);
CORBA_exception_free (&ev);