File tree 2 files changed +4
-4
lines changed
Generals/Code/GameEngineDevice/Source/Win32Device/Common
GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) {
77
77
Int archiveFileSize = 0 ;
78
78
Int numLittleFiles = 0 ;
79
79
80
- ArchiveFile *archiveFile = NEW Win32BIGFile;
81
-
82
80
DEBUG_LOG ((" Win32BIGFileSystem::openArchiveFile - opening BIG file %s\n " , filename));
83
81
84
82
if (fp == NULL ) {
@@ -120,6 +118,8 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) {
120
118
fp->seek (0x10 , File::START);
121
119
// read in each directory listing.
122
120
ArchivedFileInfo *fileInfo = NEW ArchivedFileInfo;
121
+ // TheSuperHackers @fix Mauller 23/04/2025 Only create the new file instance when it is necassary or we leak file handles!
122
+ ArchiveFile *archiveFile = NEW Win32BIGFile;
123
123
124
124
for (Int i = 0 ; i < numLittleFiles; ++i) {
125
125
Int filesize = 0 ;
Original file line number Diff line number Diff line change @@ -90,8 +90,6 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) {
90
90
Int archiveFileSize = 0 ;
91
91
Int numLittleFiles = 0 ;
92
92
93
- ArchiveFile *archiveFile = NEW Win32BIGFile;
94
-
95
93
DEBUG_LOG ((" Win32BIGFileSystem::openArchiveFile - opening BIG file %s\n " , filename));
96
94
97
95
if (fp == NULL ) {
@@ -133,6 +131,8 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) {
133
131
fp->seek (0x10 , File::START);
134
132
// read in each directory listing.
135
133
ArchivedFileInfo *fileInfo = NEW ArchivedFileInfo;
134
+ // TheSuperHackers @fix Mauller 23/04/2025 Only create the new file instance when it is necassary or we leak file handles!
135
+ ArchiveFile *archiveFile = NEW Win32BIGFile;
136
136
137
137
for (Int i = 0 ; i < numLittleFiles; ++i) {
138
138
Int filesize = 0 ;
You can’t perform that action at this time.
0 commit comments