-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling idevicerestore program in multi-threaded applications #663
Comments
Just updated my local environment for this issue.
In some instances during testing, the REMOVE_EVENT did not arrive for a device that was successfully restored. Current solution might be causing an indefinite loop since the flag is not being reset properly. It might need another flag for this case. |
I recommend adding a flag, such as |
Hello Nikias Bassen, Could you please review the following content? I would greatly appreciate any insights or feedback you could provide. Regarding the implementation in restore.c. There are two static variables declared:
It appears that the static variable Additionally, it would be more efficient and maintainable to refactor the restore_finished variable. Instead of being a static variable, it would be better to integrate it into the idevicerestore_client_t C struct as a member variable. Best regards, |
I also hope there is a version that supports multi-threaded concurrency |
This problem may be similar to what you said |
I'm encountering an issue when using idevicerestore in a multi-threaded application. The problem arises after the idevicerestore_start function finishes restoring an iOS device. The application releases the idevicerestore_client instance, but a remove event arrives later, causing the application to crash. The crash occurs at the
strcmp(event->udid, client->udid)
line in the callback function because the client instance has already been released.Here is the relevant part of the callback function that handles the remove event:
I attempted to manage the client release by waiting for the ignore_device_add_events flag to reset using the following code, but it did not work as expected:
Here is the full C++ code that demonstrates how the client instance is managed and released:
I would appreciate any suggestions or insights on how to properly manage the idevicerestore client release in a multi-threaded application. Specifically, I'm looking for guidance on ensuring that the remove event is handled correctly before releasing the client instance to prevent crashes.
The text was updated successfully, but these errors were encountered: