diff options
author | Dan Williams <dcbw@redhat.com> | 2011-04-19 11:07:46 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-04-19 11:07:46 -0500 |
commit | 2a5cf2978b60cbcb98a79cb5b7c2da8159a27f2f (patch) | |
tree | b489ef2a4a61bd599e39d963fd2b6e4e984f18b0 | |
parent | 76bdc658d31c8c64dd74a120ec68d8126dd273cf (diff) |
zte: only dispose Icera data once
-rw-r--r-- | plugins/mm-modem-zte.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/mm-modem-zte.c b/plugins/mm-modem-zte.c index 99652f57..e7387a05 100644 --- a/plugins/mm-modem-zte.c +++ b/plugins/mm-modem-zte.c @@ -39,6 +39,7 @@ G_DEFINE_TYPE_EXTENDED (MMModemZte, mm_modem_zte, MM_TYPE_GENERIC_GSM, 0, #define MM_MODEM_ZTE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MM_TYPE_MODEM_ZTE, MMModemZtePrivate)) typedef struct { + gboolean disposed; gboolean init_retried; guint32 cpms_tries; guint cpms_timeout; @@ -667,10 +668,14 @@ dispose (GObject *object) MMModemZte *self = MM_MODEM_ZTE (object); MMModemZtePrivate *priv = MM_MODEM_ZTE_GET_PRIVATE (self); - if (priv->cpms_timeout) - g_source_remove (priv->cpms_timeout); + if (priv->disposed == FALSE) { + priv->disposed = TRUE; - mm_modem_icera_dispose_private (MM_MODEM_ICERA (self)); + if (priv->cpms_timeout) + g_source_remove (priv->cpms_timeout); + + mm_modem_icera_dispose_private (MM_MODEM_ICERA (self)); + } G_OBJECT_CLASS (mm_modem_zte_parent_class)->dispose (object); } |