mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 03:35:26 +00:00
AsyncRequests: In-class initialize class members
Prior to this change, it's possible for m_wake_me_up_again to be used while it's in an uninitialized state from the exposed API. e.g. - Using SetEnable after construction would perform an uninitialized read. - Using PushEvent would perform an uninitialized read by way of operator |=. internally, an uninitialized read can happen if PullEventsInternal() is executed before other functions. Just to avoid the whole possibility of performing uninitialized reads, we just give the class member a default value of false.
This commit is contained in:
parent
bf8ffe5bfb
commit
672665dec0
@ -12,9 +12,7 @@
|
||||
|
||||
AsyncRequests AsyncRequests::s_singleton;
|
||||
|
||||
AsyncRequests::AsyncRequests() : m_enable(false), m_passthrough(true)
|
||||
{
|
||||
}
|
||||
AsyncRequests::AsyncRequests() = default;
|
||||
|
||||
void AsyncRequests::PullEventsInternal()
|
||||
{
|
||||
|
@ -90,9 +90,9 @@ private:
|
||||
std::mutex m_mutex;
|
||||
std::condition_variable m_cond;
|
||||
|
||||
bool m_wake_me_up_again;
|
||||
bool m_enable;
|
||||
bool m_passthrough;
|
||||
bool m_wake_me_up_again = false;
|
||||
bool m_enable = false;
|
||||
bool m_passthrough = true;
|
||||
|
||||
std::vector<EfbPokeData> m_merged_efb_pokes;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user