mirror of git://git.sysmocom.de/ofono
hsomodem: Use g_at_chat_clone
This commit is contained in:
parent
fa8f094a96
commit
ecc774b0f2
|
@ -363,9 +363,9 @@ static int hso_gprs_context_probe(struct ofono_gprs_context *gc,
|
|||
struct gprs_context_data *gcd;
|
||||
|
||||
gcd = g_new0(struct gprs_context_data, 1);
|
||||
gcd->chat = chat;
|
||||
gcd->chat = g_at_chat_clone(chat);
|
||||
|
||||
g_at_chat_register(chat, "_OWANCALL:", owancall_notifier,
|
||||
g_at_chat_register(gcd->chat, "_OWANCALL:", owancall_notifier,
|
||||
FALSE, gc, NULL);
|
||||
|
||||
ofono_gprs_context_set_data(gc, gcd);
|
||||
|
@ -378,6 +378,8 @@ static void hso_gprs_context_remove(struct ofono_gprs_context *gc)
|
|||
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
|
||||
|
||||
ofono_gprs_context_set_data(gc, NULL);
|
||||
|
||||
g_at_chat_unref(gcd->chat);
|
||||
g_free(gcd);
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ static int hso_radio_settings_probe(struct ofono_radio_settings *rs,
|
|||
if (!rsd)
|
||||
return -ENOMEM;
|
||||
|
||||
rsd->chat = chat;
|
||||
rsd->chat = g_at_chat_clone(chat);
|
||||
|
||||
ofono_radio_settings_set_data(rs, rsd);
|
||||
|
||||
|
@ -187,6 +187,8 @@ static void hso_radio_settings_remove(struct ofono_radio_settings *rs)
|
|||
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
|
||||
|
||||
ofono_radio_settings_set_data(rs, NULL);
|
||||
|
||||
g_at_chat_unref(rsd->chat);
|
||||
g_free(rsd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue