summaryrefslogtreecommitdiff
path: root/src/variable.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
committerBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
commite07367524c4fb4483057a7d7f983015f66071157 (patch)
tree637b5ec5a9cd9b1d0d0200f39ac77542077de8e2 /src/variable.cc
parent33e7dc3baa6b375efb6d8989ffe3c50511291228 (diff)
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.
Diffstat (limited to 'src/variable.cc')
-rw-r--r--src/variable.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/variable.cc b/src/variable.cc
index c2fe5de5..65775bef 100644
--- a/src/variable.cc
+++ b/src/variable.cc
@@ -461,14 +461,9 @@ char *keymap_act[KEYMAP_MODES][256];
/*** Player information ***/
/*
- * Static player info record
- */
-player_type p_body;
-
-/*
* Pointer to the player info
*/
-player_type *p_ptr = &p_body;
+player_type *p_ptr = nullptr;
/*
* Pointer to the player tables