Commit Graph

12 Commits

Author SHA1 Message Date
Phaedrus Leeds
756b9eae14 common: Fix several memory leaks 2021-05-04 10:23:13 +02:00
Alexander Larsson
c4a9025145 flatpak-progress: Empty the progress main context at the end
This is similar to the previous commmit, but for the main context
we add when forwarding the process callbacks.
2021-03-19 10:59:04 +01:00
Alexander Larsson
7b5a0a5c86 Fix extra-data progress reporting
We were never calling the progress callback for extra-data downloaded
bytes.
2020-10-29 17:19:38 +01:00
Alexander Larsson
7622aab962 OCI: Fix progress reporting
Somewhere during the progress reporting cleanup we lost the progress
for OCI pulls, this puts it back.
2020-09-14 09:30:14 +02:00
Alexander Larsson
a154b7d28a Progress: Artificially limit progress to 100%
Due to bugs in ostree (see
e.g. https://github.com/flatpak/flatpak/pull/3524) it sometimes
happens that we download more data than we expect to. This isn't
great, but when it happens its better to limit the progress to 100%
anyway to avoid breaking apps (for example, the flatpak CLI doesn't
really handle this very well).
2020-04-03 12:53:16 +02:00
Alexander Larsson
c222f03c10 FlatpakProgress: Clean up APIs for handling extra data
We don't need to keep recalculating the nr of extra_data items remaining.
We know the initial value and can just decrement it each time one
completes.
2020-03-27 17:23:13 +01:00
Alexander Larsson
b7f0c17762 FlatpakProgress: Handle NULL in most methods
I noticed several places in flatpak-dir.c that didn't check for
NULL progress, so lets move the check inside the implementation so
we can ensure its always checked.
2020-03-27 16:04:36 +01:00
Alexander Larsson
52224b0463 FlatpakProgress: Move default value into FlatpakProgress 2020-03-27 16:04:36 +01:00
Alexander Larsson
b1b1a6e568 FlatpakProgress: Free the GMainContext 2020-03-27 14:45:57 +01:00
Alexander Larsson
4ef12c5bc9 FlatpakProgress: No need to allocate FlatpakMainContext
We store it on the stack instead and free with
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC.
2020-03-27 14:44:00 +01:00
Alexander Larsson
a529c149ca FlatpakProgress: Use uint for bitfields
gboolean is int which is signed, and that is not good for bitfields
2020-03-27 14:40:22 +01:00
Abderrahim Kitouni
192d31d315 Add a FlatpakProgress object
To avoid the complexities of passing (and chaining) OstreeAsyncProgress
objects around, we only create one just before calling to ostree.
The rest of flatpak only ever uses the new FlatpakProgress object.

Co-authored by: Philip Chimento <philip@endlessm.com>
2020-03-26 21:09:19 +01:00