diff --git a/applications/bad_usb/bad_usb_app.c b/applications/bad_usb/bad_usb_app.c index 9fa824dc8..180d87959 100644 --- a/applications/bad_usb/bad_usb_app.c +++ b/applications/bad_usb/bad_usb_app.c @@ -104,7 +104,7 @@ BadUsbApp* bad_usb_app_alloc(char* arg) { if(!string_empty_p(app->file_path)) { scene_manager_next_scene(app->scene_manager, BadUsbSceneWork); } else { - string_set_str(app->file_path, BAD_USB_APP_PATH_SCRIPT_FOLDER); + string_set_str(app->file_path, BAD_USB_APP_BASE_FOLDER); scene_manager_next_scene(app->scene_manager, BadUsbSceneFileSelect); } } @@ -115,14 +115,14 @@ BadUsbApp* bad_usb_app_alloc(char* arg) { void bad_usb_app_free(BadUsbApp* app) { furi_assert(app); - if(app->bad_usb_script) { + if(app->bad_usb_script != NULL) { bad_usb_script_close(app->bad_usb_script); app->bad_usb_script = NULL; } // Views view_dispatcher_remove_view(app->view_dispatcher, BadUsbAppViewWork); - view_dispatcher_remove_view(app->view_dispatcher, BadUsbAppViewConfigLayout); + bad_usb_free(app->bad_usb_view); // Custom Widget diff --git a/applications/bad_usb/bad_usb_app_i.h b/applications/bad_usb/bad_usb_app_i.h index e456aa20e..392411485 100644 --- a/applications/bad_usb/bad_usb_app_i.h +++ b/applications/bad_usb/bad_usb_app_i.h @@ -15,7 +15,6 @@ #include "views/bad_usb_view.h" #define BAD_USB_APP_BASE_FOLDER ANY_PATH("badusb") -#define BAD_USB_APP_PATH_SCRIPT_FOLDER BAD_USB_APP_BASE_FOLDER #define BAD_USB_APP_PATH_LAYOUT_FOLDER BAD_USB_APP_BASE_FOLDER "/layouts" #define BAD_USB_APP_SCRIPT_EXTENSION ".txt" #define BAD_USB_APP_LAYOUT_EXTENSION ".kl" @@ -45,5 +44,4 @@ typedef enum { BadUsbAppViewError, BadUsbAppViewWork, BadUsbAppViewConfig, - BadUsbAppViewConfigLayout, } BadUsbAppView; \ No newline at end of file