* [PATCH] gril: avoid glib runtime warning
@ 2016-05-17 1:24 caiwen.zhang
2016-05-17 14:47 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: caiwen.zhang @ 2016-05-17 1:24 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
From: Caiwen Zhang <caiwen.zhang@intel.com>
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.
---
gril/gril.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gril/gril.c b/gril/gril.c
index 297a772..a1c9661 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++) {
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gril: avoid glib runtime warning
2016-05-17 1:24 [PATCH] gril: avoid glib runtime warning caiwen.zhang
@ 2016-05-17 14:47 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2016-05-17 14:47 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Hi Caiwen,
On 05/16/2016 08:24 PM, caiwen.zhang(a)intel.com wrote:
> From: Caiwen Zhang <caiwen.zhang@intel.com>
>
> 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.
> ---
> gril/gril.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-17 14:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17 1:24 [PATCH] gril: avoid glib runtime warning caiwen.zhang
2016-05-17 14:47 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.