Skip to content

Commit ece3d09

Browse files
christoph-heissmadebr
authored andcommitted
rwcore/LoaderIMG: Add warning to loadToMemory() that it is thread-unsafe.
1 parent 77b348f commit ece3d09

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rwcore/loaders/LoaderIMG.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class LoaderIMGFile {
2020
/**
2121
\class LoaderIMG
2222
\brief Parses the structure of GTA .IMG archives and loads the files in it
23+
Warning: loadToMemory() is thread-unsafe, refer to its description.
2324
*/
2425
class LoaderIMG {
2526
public:
@@ -43,6 +44,10 @@ class LoaderIMG {
4344

4445
/// Load a file from the archive to memory and pass a pointer to it
4546
/// Warning: Returns nullptr if by any reason it can't load the file
47+
//
48+
/// Warning: CURRENTLY NOT THREADSAFE!
49+
// This method access/modifies m_archive_stream unconditionally,
50+
// be aware of that.
4651
std::unique_ptr<char[]> loadToMemory(const std::string& assetname);
4752

4853
/// Writes the contents of assetname to filename

0 commit comments

Comments
 (0)