summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaiwen Zhang <caiwen.zhang@intel.com>2016-05-17 09:24:39 +0800
committerDenis Kenzior <denkenz@gmail.com>2016-05-17 09:46:35 -0500
commit16efc8b6e2b9463852b09449eac041099fdc3130 (patch)
tree3dad77ce53d6e193d8d2f506e3cee15546de47a2
parent6c328f8529a3b91cc09fcfcce3b6867174a1d888 (diff)
downloadofono-16efc8b6e2b9463852b09449eac041099fdc3130.tar.gz
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.
-rw-r--r--gril/gril.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gril/gril.c b/gril/gril.c
index 297a7720..a1c9661a 100644
--- a/gril/gril.c
+++ b/gril/gril.c
@@ -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++) {