mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-31 19:20:26 +00:00
Avoid possible race condition on NIFFile::sLoadUnsupportedFiles
Its value is written from the main thread but other threads read it.
This commit is contained in:
parent
fbd95516f4
commit
283b68025c
@ -344,7 +344,7 @@ bool NIFFile::getUseSkinning() const
|
|||||||
return mUseSkinning;
|
return mUseSkinning;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NIFFile::sLoadUnsupportedFiles = false;
|
std::atomic_bool NIFFile::sLoadUnsupportedFiles = false;
|
||||||
|
|
||||||
void NIFFile::setLoadUnsupportedFiles(bool load)
|
void NIFFile::setLoadUnsupportedFiles(bool load)
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
#include <components/debug/debuglog.hpp>
|
#include <components/debug/debuglog.hpp>
|
||||||
#include <components/files/constrainedfilestream.hpp>
|
#include <components/files/constrainedfilestream.hpp>
|
||||||
@ -65,7 +66,7 @@ class NIFFile final : public File
|
|||||||
|
|
||||||
bool mUseSkinning = false;
|
bool mUseSkinning = false;
|
||||||
|
|
||||||
static bool sLoadUnsupportedFiles;
|
static std::atomic_bool sLoadUnsupportedFiles;
|
||||||
|
|
||||||
/// Parse the file
|
/// Parse the file
|
||||||
void parse(Files::IStreamPtr stream);
|
void parse(Files::IStreamPtr stream);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user