[PATCH] cdma-voicecall: Fix for crash when unregistering atom

2011-06-13 Thread Dara Spieker-Doyle
---
 src/cdma-voicecall.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/cdma-voicecall.c b/src/cdma-voicecall.c
index a590063..2bdf850 100644
--- a/src/cdma-voicecall.c
+++ b/src/cdma-voicecall.c
@@ -335,6 +335,18 @@ void ofono_cdma_voicecall_driver_unregister(
g_drivers = g_slist_remove(g_drivers, (void *)d);
 }
 
+static void cdma_voicecall_unregister(struct ofono_atom *atom)
+{
+   DBusConnection *conn = ofono_dbus_get_connection();
+   struct ofono_modem *modem = __ofono_atom_get_modem(atom);
+   const char *path = __ofono_atom_get_path(atom);
+
+   g_dbus_unregister_interface(conn, path,
+   OFONO_CDMA_VOICECALL_MANAGER_INTERFACE);
+   ofono_modem_remove_interface(modem,
+   OFONO_CDMA_VOICECALL_MANAGER_INTERFACE);
+}
+
 static void voicecall_manager_remove(struct ofono_atom *atom)
 {
struct ofono_cdma_voicecall *vc = __ofono_atom_get_data(atom);
@@ -405,6 +417,8 @@ void ofono_cdma_voicecall_register(struct 
ofono_cdma_voicecall *vc)
 
ofono_modem_add_interface(modem,
OFONO_CDMA_VOICECALL_MANAGER_INTERFACE);
+
+   __ofono_atom_register(vc-atom, cdma_voicecall_unregister);
 }
 
 void ofono_cdma_voicecall_remove(struct ofono_cdma_voicecall *vc)
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] cdma-voicecall: Fix for crash when unregistering atom

2011-06-13 Thread Dara Spieker-Doyle

On 06/13/2011 03:37 PM, Dara Spieker-Doyle wrote:

---
  src/cdma-voicecall.c |   14 ++
  1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/cdma-voicecall.c b/src/cdma-voicecall.c
index a590063..2bdf850 100644
--- a/src/cdma-voicecall.c
+++ b/src/cdma-voicecall.c
@@ -335,6 +335,18 @@ void ofono_cdma_voicecall_driver_unregister(
g_drivers = g_slist_remove(g_drivers, (void *)d);
  }

Please ignore this patch as it contains incorrect formatting. I shall 
resubmit.


Regards
Dara

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono