PackageKit/PackageKit-1.2.7-upstream-fix-pk_transaction_dispose-assertion_failed.patch

33 lines
1.3 KiB
Diff

From 96a05994d528777ad7708c49dac012145693df1d Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Sun, 27 Aug 2023 19:04:20 +0200
Subject: [PATCH] transaction: We only need to emit finished when we were
committed
A transaction that has been staged but never actually has been committed
to run will never emit a ::Finished signal, and in this case that is
acceptable behavior.
Resolves: #656
---
src/pk-transaction.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index c9856b0a3..39ef37c97 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -5524,8 +5524,10 @@ pk_transaction_dispose (GObject *object)
}
if (transaction->priv->registration_id > 0) {
- /* We should have emitted ::Finished if the object was ever registered */
- g_assert (transaction->priv->emitted_finished);
+ /* We should have emitted ::Finished if the object was ever registered and committed */
+ if (transaction->priv->state != PK_TRANSACTION_STATE_UNKNOWN &&
+ transaction->priv->state != PK_TRANSACTION_STATE_NEW)
+ g_assert (transaction->priv->emitted_finished);
g_dbus_connection_unregister_object (transaction->priv->connection,
transaction->priv->registration_id);