Skip to content

Commit

Permalink
Make owned serial a pointer-to-non-const
Browse files Browse the repository at this point in the history
The file handler owns the serial, so it needs to free it. Therefore, it
should not be a pointer-to-const.
  • Loading branch information
rom1v committed May 24, 2019
1 parent b3bd5f1 commit c3779d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/file_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ file_handler_destroy(struct file_handler *file_handler) {
SDL_DestroyCond(file_handler->event_cond);
SDL_DestroyMutex(file_handler->mutex);
request_queue_destroy(&file_handler->queue);
SDL_free((void *) file_handler->serial);
SDL_free(file_handler->serial);
}

static process_t
Expand Down
2 changes: 1 addition & 1 deletion app/src/file_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct request_queue {
};

struct file_handler {
const char *serial;
char *serial;
SDL_Thread *thread;
SDL_mutex *mutex;
SDL_cond *event_cond;
Expand Down

0 comments on commit c3779d8

Please sign in to comment.