Roman Shchekin 2 лет назад
Родитель
Сommit
0586b182ae
4 измененных файлов с 7 добавлено и 5 удалено
  1. 1 1
      helpers/hex_viewer_storage.c
  2. 4 1
      hex_viewer.c
  3. 0 1
      hex_viewer.h
  4. 2 2
      views/hex_viewer_startscreen.c

+ 1 - 1
helpers/hex_viewer_storage.c

@@ -123,7 +123,7 @@ bool hex_viewer_open_file(void* context, const char* file_path) {
     // TODO Separate function?
     if(hex_viewer->model->stream) {
         buffered_file_stream_close(hex_viewer->model->stream);
-        stream_free(hex_viewer->model->stream); // TODO Check
+        stream_free(hex_viewer->model->stream);
         hex_viewer->model->file_offset = 0;
     }
 

+ 4 - 1
hex_viewer.c

@@ -87,7 +87,10 @@ HexViewer* hex_viewer_app_alloc() {
 void hex_viewer_app_free(HexViewer* app) {
     furi_assert(app);
 
-    if(app->model->stream) buffered_file_stream_close(app->model->stream);
+    if(app->model->stream) {
+        buffered_file_stream_close(app->model->stream);
+        stream_free(app->model->stream);
+    }
 
     // Scene manager
     scene_manager_free(app->scene_manager);

+ 0 - 1
hex_viewer.h

@@ -43,7 +43,6 @@ typedef struct {
     Stream* stream;
 } HexViewerModel;
 
-// TODO Clean
 typedef struct {
     HexViewerModel* model;
 

+ 2 - 2
views/hex_viewer_startscreen.c

@@ -61,7 +61,7 @@ void hex_viewer_startscreen_draw(Canvas* canvas, HexViewerStartscreenModel* mode
                 width,
                 0,
                 ROW_HEIGHT * HEX_VIEWER_LINES_ON_SCREEN,
-                first_line_on_screen, // TODO
+                first_line_on_screen,
                 line_count - (HEX_VIEWER_LINES_ON_SCREEN - 1));
         }
 
@@ -128,7 +128,7 @@ bool hex_viewer_startscreen_input(InputEvent* event, void* context) {
     furi_assert(context);
     HexViewerStartscreen* instance = context;
     HexViewer* app = instance->context; // TO so good, but works
-    // TODO InputTypeShort?
+
     if(event->type == InputTypeRelease || event->type == InputTypeRepeat) {
         switch(event->key) {
         case InputKeyBack: