MemoryWriter: Initialize member variables to deterministic values

Makes the variable initialization behavior deterministic in the case of
the default constructor. This also eliminates the possibility of an
uninitialized read from occurring within the destructor entirely; even
in the face of future changes.
This commit is contained in:
Lioncash 2019-09-05 01:12:05 -04:00
parent f099ee0b1b
commit 016e14c460
1 changed files with 5 additions and 5 deletions

View File

@ -90,11 +90,11 @@ public:
void writeUBytes(const atUint8* data, atUint64 length) override;
MemoryWriter() {}
atUint8* m_data;
atUint64 m_length;
atUint64 m_position;
bool m_bufferOwned;
MemoryWriter() = default;
atUint8* m_data = nullptr;
atUint64 m_length = 0;
atUint64 m_position = 0;
bool m_bufferOwned = false;
std::string m_filepath; //!< Path to the target file