diff options
author | Alexander Larsson <alexl@redhat.com> | 2019-12-17 14:47:44 +0100 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2019-12-18 09:46:39 +0100 |
commit | 4c3e59cd12443c3732062c8bcbd7bbf31768d249 (patch) | |
tree | dc71ee17bd47f69b760523cd0ee77c7440df2cdc /common/flatpak-utils-private.h | |
parent | 85a53947b3fe48d3f93927231c0890c2226be4bd (diff) | |
download | flatpak-4c3e59cd12443c3732062c8bcbd7bbf31768d249.tar.gz |
utils: Fix chaining of progress
With the latest ostree that enables the chaining of progress the
testsuite broke because we were not getting changed events. Looking
into this the reason seems to be that when we run the
ostree_async_progress_finish() on the chained progress it is marked
as dead, which causes ostree_async_progress_copy_state() to not copy
any data when called from handle_chained_progress().
The fix is to copy the content manually before calling the finish().
Also, the entire callback chaining system seems wildly
overcomplicated, so I simplified it by relying on the existing change
notification of OstreeAsyncProgress.
Diffstat (limited to 'common/flatpak-utils-private.h')
-rw-r--r-- | common/flatpak-utils-private.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/flatpak-utils-private.h b/common/flatpak-utils-private.h index 490992cf..579f31eb 100644 --- a/common/flatpak-utils-private.h +++ b/common/flatpak-utils-private.h @@ -828,13 +828,17 @@ OstreeAsyncProgress *flatpak_progress_new (FlatpakProgressCallback progress, #define FLATPAK_DO_CHAIN_PROGRESS 1 #endif +#ifdef FLATPAK_DO_CHAIN_PROGRESS +void flatpak_chained_progress_finish (OstreeAsyncProgress *progress); +#endif + static inline void flatpak_progress_unchain (OstreeAsyncProgress *chained_progress) { #ifdef FLATPAK_DO_CHAIN_PROGRESS if (chained_progress != NULL) { - ostree_async_progress_finish (chained_progress); + flatpak_chained_progress_finish (chained_progress); g_object_unref (chained_progress); } #endif |