Skip to content

Commit 5fbc4f4

Browse files
committed
Free IR controller if alloced.
1 parent 6a56928 commit 5fbc4f4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

laser_tag_app.c

+4
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ static bool laser_tag_app_enter_game_state(LaserTagApp* app) {
263263
laser_tag_view_update(app->view, app->game_state);
264264
FURI_LOG_D(TAG, "View updated with new game state");
265265

266+
if(app->ir_controller) {
267+
infrared_controller_free(app->ir_controller);
268+
app->ir_controller = NULL;
269+
}
266270
app->ir_controller = infrared_controller_alloc();
267271
if(!app->ir_controller) {
268272
FURI_LOG_E(TAG, "Failed to allocate IR controller");

0 commit comments

Comments
 (0)