Skip to content

Commit

Permalink
thread safety anti crash stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
BoyC committed Apr 9, 2022
1 parent 4b9d746 commit c74f46d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions BuildCount.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
//Automatically generated build count file. DO NOT EDIT MANUALLY!

#define BUILD_COUNT_ANUBIS 91
#define BUILD_COUNT_DESKTOP_EDTCHAL 3605
#define BUILD_COUNT_DESKTOP_EDTCHAL 3607

#define RELEASE_COUNT_ANUBIS 0
#define RELEASE_COUNT_DESKTOP_EDTCHAL 64
#define RELEASE_COUNT_DESKTOP_EDTCHAL 65

#define BUILDCOUNT (BUILD_COUNT_ANUBIS+BUILD_COUNT_DESKTOP_EDTCHAL)
#define RELEASECOUNT (RELEASE_COUNT_ANUBIS+RELEASE_COUNT_DESKTOP_EDTCHAL)
2 changes: 1 addition & 1 deletion MarkerPack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ void ImportPOIFile( CWBApplication* App, CString s, TBOOL External )
{
CXMLDocument d;
{
CLightweightCriticalSection fileWrite( &zipCritSec );
CLightweightCriticalSection fileRead( &zipCritSec );
if ( !d.LoadFromFile( s.GetPointer() ) )
return;
}
Expand Down
6 changes: 6 additions & 0 deletions TrailLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ CCoreTexture2D* GW2TrailDisplay::GetTexture( const CString& fname, const CString
if ( !categoryZip.Length() && x == 1 )
continue;

extern LIGHTWEIGHT_CRITICALSECTION zipCritSec;
CLightweightCriticalSection fileRead( &zipCritSec );

mz_zip_archive* zip = x == 0 ? OpenZipFile( zipFile ) : OpenZipFile( categoryZip );

if ( zip )
Expand Down Expand Up @@ -975,6 +978,9 @@ TBOOL GW2Trail::Import( CString& fileName, const CString& zipFile, TBOOL keepPoi
{
if ( zipFile.Length() )
{
extern LIGHTWEIGHT_CRITICALSECTION zipCritSec;
CLightweightCriticalSection fileRead( &zipCritSec );

mz_zip_archive* zip = OpenZipFile( zipFile );

if ( zip )
Expand Down
3 changes: 3 additions & 0 deletions gw2tactical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ WBATLASHANDLE GetMapIcon( CWBApplication* App, CString& filename, const CString&
if ( !categoryZip.Length() && x == 1 )
continue;

extern LIGHTWEIGHT_CRITICALSECTION zipCritSec;
CLightweightCriticalSection fileRead( &zipCritSec );

mz_zip_archive* zip = x == 0 ? OpenZipFile( zipFile ) : OpenZipFile( categoryZip );

if ( zip )
Expand Down

0 comments on commit c74f46d

Please sign in to comment.