Skip to content

Commit

Permalink
fix: prevent UB on test suite exit. (#3555)
Browse files Browse the repository at this point in the history
Clear safe references on activity null
  • Loading branch information
joveeater authored Nov 5, 2023
1 parent 12a8325 commit 03cb7f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/player_activity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ void player_activity::migrate_item_position( Character &guy )
void player_activity::set_to_null()
{
type = activity_id::NULL_ID();
//Get rid of any safe references now
targets.clear();
sfx::end_activity_sounds(); // kill activity sounds when activity is nullified
}

Expand Down

0 comments on commit 03cb7f7

Please sign in to comment.