Hello community,
here is the log from the commit of package polkit-qt-1 for openSUSE:Factory checked in at 2012-01-09 15:42:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/polkit-qt-1 (Old)
and /work/SRC/openSUSE:Factory/.polkit-qt-1.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "polkit-qt-1", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/polkit-qt-1/polkit-qt-1.changes 2011-09-23 12:41:32.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.polkit-qt-1.new/polkit-qt-1.changes 2012-01-09 15:42:37.000000000 +0100
@@ -1,0 +2,5 @@
+Mon Dec 12 08:37:06 UTC 2011 - idonmez@suse.com
+
+- Add git commit d3c337da to fix kde#258916
+
+-------------------------------------------------------------------
New:
----
d3c337da.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ polkit-qt-1.spec ++++++
--- /var/tmp/diff_new_pack.Ms0KQx/_old 2012-01-09 15:42:39.000000000 +0100
+++ /var/tmp/diff_new_pack.Ms0KQx/_new 2012-01-09 15:42:39.000000000 +0100
@@ -29,6 +29,7 @@
Source0: %{name}-%{version}.tar.bz2
Source99: baselibs.conf
Patch0: ck-avoid-crash.diff
+Patch1: d3c337da.patch
BuildRequires: automoc4
BuildRequires: cmake
BuildRequires: kde4-filesystem
@@ -73,6 +74,7 @@
%prep
%setup -q
%patch0
+%patch1 -p1
%build
%cmake_kde4 -d build
++++++ d3c337da.patch ++++++
commit d3c337da01f3887da031fdb5c2ac784fb3e79210
Author: Nick Shaforostoff
Date: Mon Dec 12 01:03:35 2011 +0200
BUG: 258916
use stricter refing in all places of 'identity' keeping.
it is interesting that it would be much harder
to accidentaly make same mistake if G API was C++ style and not C.
i also moved cleanup of successful sessions in time from system shutdown
to session completion as polkit docs say it should be
diff --git a/agent/polkitqt1-agent-session.cpp b/agent/polkitqt1-agent-session.cpp
index 20cd403..52ddacf 100644
--- a/agent/polkitqt1-agent-session.cpp
+++ b/agent/polkitqt1-agent-session.cpp
@@ -46,7 +46,7 @@ public:
Session::Private::~Private()
{
- g_object_unref(polkitAgentSession);
+ // polkitAgentSession is freed in Session d'tor
}
Session::Session(const PolkitQt1::Identity &identity, const QString &cookie, AsyncResult *result, QObject *parent)
@@ -74,6 +74,9 @@ Session::Session(PolkitAgentSession *pkAgentSession, QObject *parent)
Session::~Session()
{
+ if (d->polkitAgentSession)
+ g_object_unref(d->polkitAgentSession);
+
delete d;
}
@@ -101,7 +104,11 @@ void Session::Private::completed(PolkitAgentSession *s, gboolean gained_authoriz
{
qDebug() << "COMPLETED";
Session *session = (Session *)user_data;
- Q_EMIT((Session *)user_data)->completed(gained_authorization);
+ Q_EMIT(session)->completed(gained_authorization);
+
+ //free session here as polkit documentation asks
+ g_object_unref(session->d->polkitAgentSession);
+ session->d->polkitAgentSession = 0;
}
void Session::Private::request(PolkitAgentSession *s, gchar *request, gboolean echo_on, gpointer user_data)
@@ -139,7 +146,8 @@ AsyncResult::AsyncResult(GSimpleAsyncResult *result)
AsyncResult::~AsyncResult()
{
- g_object_unref(d->result);
+ if (d->result)
+ g_object_unref(d->result);
}
void AsyncResult::setCompleted()
diff --git a/core/polkitqt1-identity.cpp b/core/polkitqt1-identity.cpp
index abf5abb..9cef558 100644
--- a/core/polkitqt1-identity.cpp
+++ b/core/polkitqt1-identity.cpp
@@ -35,11 +35,13 @@ public:
: QSharedData(other)
, identity(other.identity)
{
- g_object_ref(identity);
+ if (identity)
+ g_object_ref(identity);
}
~Data()
{
- g_object_unref(identity);
+ if (identity)
+ g_object_unref(identity);
}
PolkitIdentity *identity;
@@ -56,6 +58,8 @@ Identity::Identity(PolkitIdentity *polkitIdentity)
{
g_type_init();
d->identity = polkitIdentity;
+ if (d->identity)
+ g_object_ref(d->identity);
}
Identity::Identity(const PolkitQt1::Identity& other)
@@ -86,7 +90,14 @@ PolkitIdentity *Identity::identity() const
void Identity::setIdentity(PolkitIdentity *identity)
{
+ if (d->identity == identity)
+ return;
+
+ if (d->identity)
+ g_object_unref(d->identity);
d->identity = identity;
+ if (d->identity)
+ g_object_ref(d->identity);
}
QString Identity::toString() const
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org