Browse Source

Fix for crash on exit in 0.100.3

David Lee 1 year ago
parent
commit
642afe4387
7 changed files with 24 additions and 16 deletions
  1. 1 1
      application.fam
  2. 4 0
      docs/changelog.md
  3. 1 14
      views/xremote_infoscreen.c
  4. 9 0
      views/xremote_pause_set.c
  5. 1 0
      views/xremote_pause_set.h
  6. 7 0
      xremote.c
  7. 1 1
      xremote_i.h

+ 1 - 1
application.fam

@@ -6,7 +6,7 @@ App(
     stack_size=3 * 1024,
     stack_size=3 * 1024,
     fap_icon="icons/xremote_10px.png",
     fap_icon="icons/xremote_10px.png",
     fap_icon_assets="icons",
     fap_icon_assets="icons",
-    fap_version="2.4",
+    fap_version="2.5",
     fap_category="Infrared",
     fap_category="Infrared",
     fap_author="Leedave",
     fap_author="Leedave",
     fap_description="One-Click, sends multiple commands",
     fap_description="One-Click, sends multiple commands",

+ 4 - 0
docs/changelog.md

@@ -1,3 +1,7 @@
+## 2.5
+- Back button on info screen now reacts the same as ok button
+- Fixed crash on exit in fw 0.100.3
+
 ## 2.4
 ## 2.4
 - Added support for encoded SubGhz files
 - Added support for encoded SubGhz files
 - Added timer for SubGhz transmission (not needed in RAW files)
 - Added timer for SubGhz transmission (not needed in RAW files)

+ 1 - 14
views/xremote_infoscreen.c

@@ -47,19 +47,6 @@ bool xremote_infoscreen_input(InputEvent* event, void* context) {
     if(event->type == InputTypeRelease) {
     if(event->type == InputTypeRelease) {
         switch(event->key) {
         switch(event->key) {
         case InputKeyBack:
         case InputKeyBack:
-            with_view_model(
-                instance->view,
-                XRemoteInfoscreenModel * model,
-                {
-                    UNUSED(model);
-                    instance->callback(XRemoteCustomEventInfoscreenBack, instance->context);
-                },
-                true);
-            break;
-        case InputKeyLeft:
-        case InputKeyRight:
-        case InputKeyUp:
-        case InputKeyDown:
         case InputKeyOk:
         case InputKeyOk:
             with_view_model(
             with_view_model(
                 instance->view,
                 instance->view,
@@ -70,7 +57,7 @@ bool xremote_infoscreen_input(InputEvent* event, void* context) {
                 },
                 },
                 true);
                 true);
             break;
             break;
-        case InputKeyMAX:
+        default:
             break;
             break;
         }
         }
     }
     }

+ 9 - 0
views/xremote_pause_set.c

@@ -126,4 +126,13 @@ void xremote_pause_set_enter(void* context) {
 View* xremote_pause_set_get_view(XRemotePauseSet* instance) {
 View* xremote_pause_set_get_view(XRemotePauseSet* instance) {
     furi_assert(instance);
     furi_assert(instance);
     return instance->view;
     return instance->view;
+}
+
+void xremote_pause_set_free(XRemotePauseSet* instance) {
+    furi_assert(instance);
+
+    with_view_model(
+        instance->view, XRemotePauseSetModel * model, { UNUSED(model); }, true);
+    view_free(instance->view);
+    free(instance);
 }
 }

+ 1 - 0
views/xremote_pause_set.h

@@ -17,6 +17,7 @@ void xremote_pause_set_set_callback(
     void* context);
     void* context);
 
 
 XRemotePauseSet* xremote_pause_set_alloc();
 XRemotePauseSet* xremote_pause_set_alloc();
+void xremote_pause_set_free(XRemotePauseSet* instance);
 
 
 void xremote_pause_set_enter(void* context);
 void xremote_pause_set_enter(void* context);
 
 

+ 7 - 0
xremote.c

@@ -140,14 +140,18 @@ void xremote_app_free(XRemote* app) {
 
 
     // View Dispatcher
     // View Dispatcher
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdMenu);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdMenu);
+    view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdEditItem);
+    view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdInfoscreen);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdCreate);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdCreate);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdCreateAdd);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdCreateAdd);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdSettings);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdSettings);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdWip);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdWip);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdStack);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdStack);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdTextInput);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdTextInput);
+    view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdIntInput);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdTransmit);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdTransmit);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdPauseSet);
     view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdPauseSet);
+    view_dispatcher_remove_view(app->view_dispatcher, XRemoteViewIdIrRemote);
     text_input_free(app->text_input);
     text_input_free(app->text_input);
     int_input_free(app->int_input);
     int_input_free(app->int_input);
     button_menu_free(app->button_menu_create);
     button_menu_free(app->button_menu_create);
@@ -156,6 +160,9 @@ void xremote_app_free(XRemote* app) {
     view_stack_free(app->view_stack);
     view_stack_free(app->view_stack);
     popup_free(app->popup);
     popup_free(app->popup);
     submenu_free(app->submenu);
     submenu_free(app->submenu);
+    xremote_infoscreen_free(app->xremote_infoscreen);
+    xremote_pause_set_free(app->xremote_pause_set);
+    xremote_transmit_free(app->xremote_transmit);
 
 
     view_dispatcher_free(app->view_dispatcher);
     view_dispatcher_free(app->view_dispatcher);
     furi_record_close(RECORD_GUI);
     furi_record_close(RECORD_GUI);

+ 1 - 1
xremote_i.h

@@ -53,7 +53,7 @@
 #define XREMOTE_TEXT_STORE_SIZE 128
 #define XREMOTE_TEXT_STORE_SIZE 128
 #define XREMOTE_MAX_ITEM_NAME_LENGTH 22
 #define XREMOTE_MAX_ITEM_NAME_LENGTH 22
 #define XREMOTE_MAX_REMOTE_NAME_LENGTH 22
 #define XREMOTE_MAX_REMOTE_NAME_LENGTH 22
-#define XREMOTE_VERSION "2.4"
+#define XREMOTE_VERSION "2.5"
 
 
 #define INFRARED_APP_EXTENSION ".ir"
 #define INFRARED_APP_EXTENSION ".ir"
 #define INFRARED_APP_FOLDER ANY_PATH("infrared")
 #define INFRARED_APP_FOLDER ANY_PATH("infrared")