Zero initialize all pointer class and struct members

This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
This commit is contained in:
Rémi Verschelde 2022-04-04 15:06:57 +02:00
parent 53317bbe14
commit f8ab79e68a
258 changed files with 2398 additions and 2421 deletions

View file

@ -37,7 +37,7 @@ class SceneCacheInterface : public MultiplayerCacheInterface {
GDCLASS(SceneCacheInterface, MultiplayerCacheInterface);
private:
MultiplayerAPI *multiplayer;
MultiplayerAPI *multiplayer = nullptr;
//path sent caches
struct PathSentCache {

View file

@ -47,7 +47,7 @@ private:
void _free_remotes(int p_peer);
Ref<SceneReplicationState> rep_state;
MultiplayerAPI *multiplayer;
MultiplayerAPI *multiplayer = nullptr;
PackedByteArray packet_cache;
int sync_mtu = 1350; // Highly dependent on underlying protocol.