summaryrefslogtreecommitdiffstats
path: root/agent/polkit-tqt-agent-session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'agent/polkit-tqt-agent-session.cpp')
-rw-r--r--agent/polkit-tqt-agent-session.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/agent/polkit-tqt-agent-session.cpp b/agent/polkit-tqt-agent-session.cpp
index b65bb90b2..eb8460be4 100644
--- a/agent/polkit-tqt-agent-session.cpp
+++ b/agent/polkit-tqt-agent-session.cpp
@@ -62,7 +62,10 @@ void Session::Private::completed(PolkitAgentSession *s, gboolean gained_authoriz
emit(session)->completed(gained_authorization);
//free session here as polkit documentation asks
- g_object_unref(session->d->polkitAgentSession);
+ if (session->d->polkitAgentSession)
+ {
+ g_object_unref(session->d->polkitAgentSession);
+ }
session->d->polkitAgentSession = 0;
}
@@ -171,7 +174,10 @@ void AsyncResult::setCompleted()
}
g_simple_async_result_complete(d->result);
// Assure that completed won't be called twice
- g_object_unref(d->result);
+ if (d->result)
+ {
+ g_object_unref(d->result);
+ }
d->result = NULL;
}