From e07367524c4fb4483057a7d7f983015f66071157 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Fri, 11 Dec 2015 08:09:30 +0100 Subject: Allocate p_ptr dynamically While this technically introduces one-time memory leak, it also lets us avoid the Static Initialization Fiasco problem if we change player_type to a non-POD. --- src/dungeon.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/dungeon.cc') diff --git a/src/dungeon.cc b/src/dungeon.cc index 62eaf211..9aaf77ed 100644 --- a/src/dungeon.cc +++ b/src/dungeon.cc @@ -5122,6 +5122,9 @@ void play_game(bool_ new_game) bool_ cheat_death = FALSE; + /* Initialize player */ + p_ptr = new player_type(); + /* Hack -- Character is "icky" */ character_icky = TRUE; -- cgit v1.2.3