Skip to content

Commit

Permalink
Free IR controller if alloced.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamisonderek committed Aug 25, 2024
1 parent 6a56928 commit 5fbc4f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions laser_tag_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ static bool laser_tag_app_enter_game_state(LaserTagApp* app) {
laser_tag_view_update(app->view, app->game_state);
FURI_LOG_D(TAG, "View updated with new game state");

if(app->ir_controller) {
infrared_controller_free(app->ir_controller);
app->ir_controller = NULL;
}
app->ir_controller = infrared_controller_alloc();
if(!app->ir_controller) {
FURI_LOG_E(TAG, "Failed to allocate IR controller");
Expand Down

0 comments on commit 5fbc4f4

Please sign in to comment.