1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 18:32:44 +01:00

rwcore/LoaderIMG: Add warning to loadToMemory() that it is thread-unsafe.

This commit is contained in:
Christoph Heiss 2020-05-19 20:48:33 +02:00 committed by Anonymous Maarten
parent 77b348f1f4
commit ece3d09e29

View File

@ -20,6 +20,7 @@ public:
/** /**
\class LoaderIMG \class LoaderIMG
\brief Parses the structure of GTA .IMG archives and loads the files in it \brief Parses the structure of GTA .IMG archives and loads the files in it
Warning: loadToMemory() is thread-unsafe, refer to its description.
*/ */
class LoaderIMG { class LoaderIMG {
public: public:
@ -43,6 +44,10 @@ public:
/// Load a file from the archive to memory and pass a pointer to it /// Load a file from the archive to memory and pass a pointer to it
/// Warning: Returns nullptr if by any reason it can't load the file /// Warning: Returns nullptr if by any reason it can't load the file
//
/// Warning: CURRENTLY NOT THREADSAFE!
// This method access/modifies m_archive_stream unconditionally,
// be aware of that.
std::unique_ptr<char[]> loadToMemory(const std::string& assetname); std::unique_ptr<char[]> loadToMemory(const std::string& assetname);
/// Writes the contents of assetname to filename /// Writes the contents of assetname to filename