diff --git a/src/main.c b/src/main.c index c959c68..6477262 100644 --- a/src/main.c +++ b/src/main.c @@ -148,6 +148,8 @@ int palera1n(int argc, char *argv[], char *envp[]) { palerain_option_device_info) ) || device_has_booted) goto normal_exit; + pthread_cancel(pongo_thread); + pthread_join(pongo_thread, NULL); if (exec_checkra1n()) goto cleanup; if ((palerain_flags & (palerain_option_pongo_exit | palerain_option_demote))) diff --git a/src/pongo_helper.c b/src/pongo_helper.c index 5369f40..cda6673 100644 --- a/src/pongo_helper.c +++ b/src/pongo_helper.c @@ -42,6 +42,9 @@ void *pongo_usb_callback(stuff_t *arg) { } #endif LOG(LOG_INFO, "Found PongoOS USB Device"); + if (palerain_flags & palerain_option_pongo_exit) + goto done; + usb_device_handle_t handle = arg->handle; #ifdef TUI if (tui_is_jailbreaking) {