voicecall: Remove sim_state_watch on atom unregister

This commit is contained in:
Jeevaka Badrappan 2011-04-06 07:26:41 -07:00 committed by Denis Kenzior
parent a3dcd49711
commit 758826919b
1 changed files with 7 additions and 6 deletions

View File

@ -2203,11 +2203,18 @@ static void voicecall_unregister(struct ofono_atom *atom)
const char *path = __ofono_atom_get_path(atom);
GSList *l;
if (vc->sim_state_watch) {
ofono_sim_remove_state_watch(vc->sim, vc->sim_state_watch);
vc->sim_state_watch = 0;
}
if (vc->sim_watch) {
__ofono_modem_remove_atom_watch(modem, vc->sim_watch);
vc->sim_watch = 0;
}
vc->sim = NULL;
if (vc->dial_req)
dial_request_finish(vc);
@ -2246,12 +2253,6 @@ static void voicecall_remove(struct ofono_atom *atom)
vc->new_en_list = NULL;
}
if (vc->sim_state_watch) {
ofono_sim_remove_state_watch(vc->sim, vc->sim_state_watch);
vc->sim_state_watch = 0;
vc->sim = NULL;
}
if (vc->tone_source) {
g_source_remove(vc->tone_source);
vc->tone_source = 0;