Skip to content

Commit 0586b18

Browse files
committed
fixes #5: stream_free added
1 parent 9857fee commit 0586b18

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

helpers/hex_viewer_storage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ bool hex_viewer_open_file(void* context, const char* file_path) {
123123
// TODO Separate function?
124124
if(hex_viewer->model->stream) {
125125
buffered_file_stream_close(hex_viewer->model->stream);
126-
stream_free(hex_viewer->model->stream); // TODO Check
126+
stream_free(hex_viewer->model->stream);
127127
hex_viewer->model->file_offset = 0;
128128
}
129129

hex_viewer.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ HexViewer* hex_viewer_app_alloc() {
8787
void hex_viewer_app_free(HexViewer* app) {
8888
furi_assert(app);
8989

90-
if(app->model->stream) buffered_file_stream_close(app->model->stream);
90+
if(app->model->stream) {
91+
buffered_file_stream_close(app->model->stream);
92+
stream_free(app->model->stream);
93+
}
9194

9295
// Scene manager
9396
scene_manager_free(app->scene_manager);

hex_viewer.h

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ typedef struct {
4343
Stream* stream;
4444
} HexViewerModel;
4545

46-
// TODO Clean
4746
typedef struct {
4847
HexViewerModel* model;
4948

views/hex_viewer_startscreen.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void hex_viewer_startscreen_draw(Canvas* canvas, HexViewerStartscreenModel* mode
6161
width,
6262
0,
6363
ROW_HEIGHT * HEX_VIEWER_LINES_ON_SCREEN,
64-
first_line_on_screen, // TODO
64+
first_line_on_screen,
6565
line_count - (HEX_VIEWER_LINES_ON_SCREEN - 1));
6666
}
6767

@@ -128,7 +128,7 @@ bool hex_viewer_startscreen_input(InputEvent* event, void* context) {
128128
furi_assert(context);
129129
HexViewerStartscreen* instance = context;
130130
HexViewer* app = instance->context; // TO so good, but works
131-
// TODO InputTypeShort?
131+
132132
if(event->type == InputTypeRelease || event->type == InputTypeRepeat) {
133133
switch(event->key) {
134134
case InputKeyBack:

0 commit comments

Comments
 (0)