flip_wifi.c 733 B

1234567891011121314151617181920212223242526272829303132
  1. #include "flip_wifi.h"
  2. #include <callback/flip_wifi_callback.h>
  3. WiFiPlaylist *wifi_playlist = NULL;
  4. // Function to free the resources used by FlipWiFiApp
  5. void flip_wifi_app_free(FlipWiFiApp *app)
  6. {
  7. if (!app)
  8. {
  9. FURI_LOG_E(TAG, "FlipWiFiApp is NULL");
  10. return;
  11. }
  12. // Free Submenu(s)
  13. if (app->submenu_main)
  14. {
  15. view_dispatcher_remove_view(app->view_dispatcher, FlipWiFiViewSubmenuMain);
  16. submenu_free(app->submenu_main);
  17. }
  18. flip_wifi_free_all(app);
  19. // free the view dispatcher
  20. if (app->view_dispatcher)
  21. view_dispatcher_free(app->view_dispatcher);
  22. // close the gui
  23. furi_record_close(RECORD_GUI);
  24. // free the app
  25. if (app)
  26. free(app);
  27. }