File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -255,12 +255,20 @@ public class File : IOChannel
255
255
{
256
256
if (output && output != input)
257
257
{
258
+ #ifdef _DEBUG
259
+ openCountMutex.Wait ();
258
260
openCount--;
261
+ openCountMutex.Release ();
262
+ #endif
259
263
fclose (output);
260
264
}
261
265
if (input)
262
266
{
267
+ #ifdef _DEBUG
268
+ openCountMutex.Wait ();
263
269
openCount--;
270
+ openCountMutex.Release ();
271
+ #endif
264
272
fclose (input);
265
273
}
266
274
input = null ;
@@ -843,7 +851,11 @@ public:
843
851
if(!input && !output);
844
852
else
845
853
{
854
+ #ifdef _DEBUG
855
+ openCountMutex.Wait();
846
856
openCount++;
857
+ openCountMutex.Release();
858
+ #endif
847
859
result = true;
848
860
// TESTING ENABLING FILE BUFFERING BY DEFAULT... DOCUMENT ANY ISSUE
849
861
/*
@@ -1002,7 +1014,10 @@ public FileAttribs FileExists(const char * fileName)
1002
1014
return FILE_FileExists (fileName);
1003
1015
}
1004
1016
1017
+ #ifdef _DEBUG
1005
1018
static int openCount;
1019
+ static Mutex openCountMutex { };
1020
+ #endif
1006
1021
1007
1022
public File FileOpen (const char * fileName, FileOpenMode mode)
1008
1023
{
@@ -1054,7 +1069,11 @@ public File FileOpen(const char * fileName, FileOpenMode mode)
1054
1069
if (!file.input && !file.output );
1055
1070
else
1056
1071
{
1072
+ #ifdef _DEBUG
1073
+ openCountMutex.Wait ();
1057
1074
openCount++;
1075
+ openCountMutex.Release ();
1076
+ #endif
1058
1077
result = file;
1059
1078
// TESTING ENABLING FILE BUFFERING BY DEFAULT... DOCUMENT ANY ISSUE
1060
1079
/*
You can’t perform that action at this time.
0 commit comments