From 5e754c6518cb64617f3f9678d1f50bf2d206b721 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 11 Sep 2009 14:06:18 -0500 Subject: Create watchlists during register --- src/modem.c | 3 ++- src/ssn.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modem.c b/src/modem.c index 1a654afa..d621bf42 100644 --- a/src/modem.c +++ b/src/modem.c @@ -1026,7 +1026,6 @@ struct ofono_modem *ofono_modem_create(const char *type) modem->driver_type = g_strdup(type); modem->properties = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, unregister_property); - modem->atom_watches = __ofono_watchlist_new(g_free); g_modem_list = g_slist_prepend(g_modem_list, modem); @@ -1094,6 +1093,8 @@ int ofono_modem_register(struct ofono_modem *modem) g_free(modem->driver_type); modem->driver_type = NULL; + modem->atom_watches = __ofono_watchlist_new(g_free); + emit_modems(); /* TODO: Read powered property from store */ diff --git a/src/ssn.c b/src/ssn.c index 6d5e279d..d8894acd 100644 --- a/src/ssn.c +++ b/src/ssn.c @@ -204,9 +204,6 @@ struct ofono_ssn *ofono_ssn_create(struct ofono_modem *modem, if (ssn == NULL) return NULL; - ssn->mo_handler_list = __ofono_watchlist_new(g_free); - ssn->mt_handler_list = __ofono_watchlist_new(g_free); - ssn->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_SSN, ssn_remove, ssn); @@ -228,6 +225,9 @@ struct ofono_ssn *ofono_ssn_create(struct ofono_modem *modem, void ofono_ssn_register(struct ofono_ssn *ssn) { + ssn->mo_handler_list = __ofono_watchlist_new(g_free); + ssn->mt_handler_list = __ofono_watchlist_new(g_free); + __ofono_atom_register(ssn->atom, ssn_unregister); } -- cgit v1.2.3