mirror of git://git.sysmocom.de/ofono
gril: avoid glib runtime warning
gril may be destroyed in the request callback (e.g in the callback of set modem power off request). 'out_queue' and 'command_queue' is NULL. there will be glib runtime warning if use them.
This commit is contained in:
parent
6c328f8529
commit
16efc8b6e2
|
@ -374,6 +374,12 @@ static void handle_response(struct ril_s *p, struct ril_msg *message)
|
|||
if (req->callback)
|
||||
req->callback(message, req->user_data);
|
||||
|
||||
/* gril may have been destroyed in the request callback */
|
||||
if (p->destroyed) {
|
||||
ril_request_destroy(req);
|
||||
return;
|
||||
}
|
||||
|
||||
len = g_queue_get_length(p->out_queue);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
|
|
Loading…
Reference in New Issue