aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/frontends/maemo/src/strongswan-status.c40
-rw-r--r--src/libcharon/plugins/maemo/maemo_service.c6
2 files changed, 24 insertions, 22 deletions
diff --git a/src/frontends/maemo/src/strongswan-status.c b/src/frontends/maemo/src/strongswan-status.c
index c77de8cf1..f9a0b766d 100644
--- a/src/frontends/maemo/src/strongswan-status.c
+++ b/src/frontends/maemo/src/strongswan-status.c
@@ -532,34 +532,30 @@ strongswan_status_init (StrongswanStatus *plugin)
gtk_widget_show_all (GTK_WIDGET (plugin));
}
+#define UNREF_IF(obj) do { \
+ if (obj) { obj = (g_object_unref (obj), NULL); } \
+} while(0)
+
static void
strongswan_status_dispose (GObject *object)
{
StrongswanStatusPrivate *priv = STRONGSWAN_STATUS (object)->priv;
- if (priv->conns)
- {
- priv->conns = (g_object_unref (priv->conns), NULL);
- }
- if (priv->icons.status_open)
- {
- g_object_unref (priv->icons.status_open);
- priv->icons.status_open = NULL;
- }
- if (priv->icons.status_close)
- {
- g_object_unref (priv->icons.status_close);
- priv->icons.status_close = NULL;
- }
- if (priv->icons.button_open)
- {
- g_object_unref (priv->icons.button_open);
- priv->icons.button_open = NULL;
- }
- if (priv->icons.button_close)
+ if (priv->context)
{
- g_object_unref (priv->icons.button_close);
- priv->icons.button_close = NULL;
+ osso_rpc_unset_cb_f (priv->context,
+ OSSO_STATUS_SERVICE,
+ OSSO_STATUS_OBJECT,
+ OSSO_STATUS_IFACE,
+ (osso_rpc_cb_f*)dbus_req_handler,
+ STRONGSWAN_STATUS (object));
+ osso_deinitialize (priv->context);
+ priv->context = NULL;
}
+ UNREF_IF(priv->conns);
+ UNREF_IF(priv->icons.status_open);
+ UNREF_IF(priv->icons.status_close);
+ UNREF_IF(priv->icons.button_open);
+ UNREF_IF(priv->icons.button_close);
G_OBJECT_CLASS (strongswan_status_parent_class)->dispose (object);
}
diff --git a/src/libcharon/plugins/maemo/maemo_service.c b/src/libcharon/plugins/maemo/maemo_service.c
index ad150d7f8..3dc61292e 100644
--- a/src/libcharon/plugins/maemo/maemo_service.c
+++ b/src/libcharon/plugins/maemo/maemo_service.c
@@ -318,6 +318,12 @@ METHOD(maemo_service_t, destroy, void,
}
if (this->context)
{
+ osso_rpc_unset_cb_f(this->context,
+ OSSO_CHARON_SERVICE,
+ OSSO_CHARON_OBJECT,
+ OSSO_CHARON_IFACE,
+ (osso_rpc_cb_f*)dbus_req_handler,
+ this);
osso_deinitialize(this->context);
}
charon->bus->remove_listener(charon->bus, &this->public.listener);