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:
Caiwen Zhang 2016-05-17 09:24:39 +08:00 committed by Denis Kenzior
parent 6c328f8529
commit 16efc8b6e2
1 changed files with 6 additions and 0 deletions

View File

@ -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++) {