Skip to content

Commit

Permalink
Merge pull request #70575 from inogenous/fix-segfault-unload-activity
Browse files Browse the repository at this point in the history
  • Loading branch information
akrieger authored Jan 1, 2024
2 parents 9f1b6ec + 398f701 commit 46cb5e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3204,8 +3204,11 @@ void unload_activity_actor::start( player_activity &act, Character & )

void unload_activity_actor::finish( player_activity &act, Character &who )
{
// Need to copy `target` here because `::unload` is static and `this` might be invalidated
// after `act.set_to_null()` has been called (so `this.target` might also be invalidated)
item_location target_copy = target;
act.set_to_null();
unload( who, target );
unload( who, target_copy );
}

void unload_activity_actor::unload( Character &who, item_location &target )
Expand Down

0 comments on commit 46cb5e4

Please sign in to comment.