From 03cb7f710974d3f5919f1bc1c383a4e87789116a Mon Sep 17 00:00:00 2001 From: joveeater Date: Sun, 5 Nov 2023 04:01:39 +0000 Subject: [PATCH] fix: prevent UB on test suite exit. (#3555) Clear safe references on activity null --- src/player_activity.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/player_activity.cpp b/src/player_activity.cpp index 9dd7d3496829..8cd39e4f07f6 100644 --- a/src/player_activity.cpp +++ b/src/player_activity.cpp @@ -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 }