Просмотр исходного кода

debug memory leak. read after load still bug

zinongli 11 месяцев назад
Родитель
Сommit
c3f3d0962d
4 измененных файлов с 4 добавлено и 4 удалено
  1. BIN
      scenes/.DS_Store
  2. 0 1
      scenes/metroflip_scene_load.c
  3. 1 0
      scenes/metroflip_scene_parse.c
  4. 3 3
      scenes/plugins/suica.c

BIN
scenes/.DS_Store


+ 0 - 1
scenes/metroflip_scene_load.c

@@ -39,7 +39,6 @@ void metroflip_scene_load_on_enter(void* context) {
     if(app->data_loaded) {
         // Direct to the parsing screen just like the auto scene does
         app->card_type = furi_string_get_cstr(card_type);
-        FURI_LOG_I(TAG, "Card type: %s", app->card_type);
         scene_manager_next_scene(app->scene_manager, MetroflipSceneParse);
     } else {
         scene_manager_search_and_switch_to_previous_scene(app->scene_manager, MetroflipSceneStart);

+ 1 - 0
scenes/metroflip_scene_parse.c

@@ -57,6 +57,7 @@ void metroflip_scene_parse_on_exit(void* context) {
         // Get and run the plugin's on_exit function
         const MetroflipPlugin* plugin = plugin_manager_get_ep(app->plugin_manager, 0);
         plugin->plugin_on_exit(app);
+        FURI_LOG_I(TAG, "Parse scene exit");
 
         plugin_manager_free(app->plugin_manager);
         composite_api_resolver_free(app->resolver);

+ 3 - 3
scenes/plugins/suica.c

@@ -379,9 +379,7 @@ static NfcCommand suica_poller_callback(NfcGenericEvent event, void* context) {
             }
 
             if(model->size == 1 && felica_poller->data->pmm.data[1] != SUICA_IC_TYPE_CODE) {
-                furi_string_printf(
-                    parsed_data,
-                    "\e#Suica\nSorry, not a Suica.\n");
+                furi_string_printf(parsed_data, "\e#Suica\nSorry, not a Suica.\n");
             }
             widget_add_text_scroll_element(
                 widget, 0, 0, 128, 64, furi_string_get_cstr(parsed_data));
@@ -569,6 +567,7 @@ static bool suica_on_event(Metroflip* app, SceneManagerEvent event) {
 
 static void suica_on_exit(Metroflip* app) {
     widget_reset(app->widget);
+    view_free_model(app->suica_context->view_history);
     view_free(app->suica_context->view_history);
     view_dispatcher_remove_view(app->view_dispatcher, MetroflipViewCanvas);
     free(app->suica_context);
@@ -577,6 +576,7 @@ static void suica_on_exit(Metroflip* app) {
         nfc_poller_stop(app->poller);
         nfc_poller_free(app->poller);
     }
+    FURI_LOG_I(TAG, "Suica scene exit");
 }
 
 /* Actual implementation of app<>plugin interface */