diff options
author | Nikias Bassen | 2017-11-05 16:14:53 +0100 |
---|---|---|
committer | Nikias Bassen | 2017-11-05 16:14:53 +0100 |
commit | f099161e3c01546d6a296fe10c59e341c679871c (patch) | |
tree | 6cb8a2462ad9de8db872cd675944b25d12bcd269 /src/restore.c | |
parent | f9b529b75982902c9b31ee59fe73e2c56b8ba237 (diff) | |
download | idevicerestore-f099161e3c01546d6a296fe10c59e341c679871c.tar.gz idevicerestore-f099161e3c01546d6a296fe10c59e341c679871c.tar.bz2 |
restore: Prevent crash in fdr_disconnect() when exiting unexpectedly
Diffstat (limited to 'src/restore.c')
-rw-r--r-- | src/restore.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/restore.c b/src/restore.c index 46e4a0f..ab7e50d 100644 --- a/src/restore.c +++ b/src/restore.c @@ -2299,12 +2299,12 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit message = NULL; } - if (fdr_control_channel) { - fdr_disconnect(fdr_control_channel); - if (fdr_thread) { + if (thread_alive(fdr_thread)) { + if (fdr_control_channel) { + fdr_disconnect(fdr_control_channel); thread_join(fdr_thread); + fdr_control_channel = NULL; } - fdr_control_channel = NULL; } restore_client_free(client); |