summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
authorGravatar Sami Kortelainen2026-10-05 15:47:06 +0300
committerGravatar Nikias Bassen2026-10-27 23:34:51 +0100
commit7dd5eba9f871a90ebcc3c62c6beef5d96e5e39f6 (patch)
tree2460817417b4b1726468e7f3d40eb4dfa8e9f8b5 /src/common.c
parent708ac9f76da507751dd6d80e240e47b74fe9a1b8 (diff)
downloadidevicerestore-7dd5eba9f871a90ebcc3c62c6beef5d96e5e39f6.tar.gz
idevicerestore-7dd5eba9f871a90ebcc3c62c6beef5d96e5e39f6.tar.bz2
Crash fix: Added one-time initialization to all three progress functions
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 70f0742..89d3b30 100644
--- a/src/common.c
+++ b/src/common.c
@@ -325,6 +325,7 @@ static void _init_progress_info(void)
uint32_t progress_get_next_tag(void)
{
+ thread_once(&progress_info_once, _init_progress_info);
mutex_lock(&prog_mutex);
uint32_t newtag = ++progress_unique_tag;
mutex_unlock(&prog_mutex);
@@ -382,6 +383,7 @@ void register_progress(uint32_t tag, const char* label)
void finalize_progress(uint32_t tag)
{
+ thread_once(&progress_info_once, _init_progress_info);
mutex_lock(&prog_mutex);
struct progress_info_entry* found = NULL;
FOREACH(struct progress_info_entry* e, &progress_info) {
@@ -424,6 +426,7 @@ void print_progress_bar(const char* prefix, double progress)
void set_progress(uint32_t tag, double progress)
{
+ thread_once(&progress_info_once, _init_progress_info);
mutex_lock(&prog_mutex);
struct progress_info_entry* found = NULL;
FOREACH(struct progress_info_entry* e, &progress_info) {