[gnome-shell] shell: Fix crash in polkit agent
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] shell: Fix crash in polkit agent
- Date: Tue, 10 Nov 2015 10:57:39 +0000 (UTC)
commit c634718dfaddc2aaa4f75709fe40f469171ed334
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Nov 6 12:21:48 2015 +0100
shell: Fix crash in polkit agent
The polkit agent does not take ownership of the request's cancellable,
so it may no longer be valid after the request finished and we need
to disconnect it before that. Before the GTask port in 8b4249ef2,
it was safe to do that when freeing the request data because requests
completed in an idle, but now we need to do it before returning the
task result.
https://bugzilla.gnome.org/show_bug.cgi?id=757668
src/shell-polkit-authentication-agent.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-polkit-authentication-agent.c b/src/shell-polkit-authentication-agent.c
index 666b023..152c6e2 100644
--- a/src/shell-polkit-authentication-agent.c
+++ b/src/shell-polkit-authentication-agent.c
@@ -207,7 +207,6 @@ struct _AuthRequest {
static void
auth_request_free (AuthRequest *request)
{
- g_cancellable_disconnect (request->cancellable, request->handler_id);
g_free (request->action_id);
g_free (request->message);
g_free (request->icon_name);
@@ -345,6 +344,7 @@ auth_request_complete (AuthRequest *request,
if (!is_current)
agent->scheduled_requests = g_list_remove (agent->scheduled_requests, request);
+ g_cancellable_disconnect (request->cancellable, request->handler_id);
if (dismissed)
g_task_return_new_error (request->simple,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]