Skip to content

Commit

Permalink
[Engine] Added debug CRT heap for Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDushan committed May 4, 2024
1 parent 3648ec8 commit c6057f1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/docs/Changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2024-05-04 Dusan Jocic <dusanjocic@msn>
* [Engine] Fixed compiling
* [Engine] Misc fixes
* [Engine] Added debug CRT heap for Windows platform

2023-06-17 Dusan Jocic <dusanjocic@msn>
* [Engine] Misc fixes
Expand Down
3 changes: 1 addition & 2 deletions src/engine/framework/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ void idCommonLocal::Error(errorParm_t code, pointer fmt, ...) {


if(com_errorEntered) {
if (!calledSysError)
{
if(!calledSysError) {
calledSysError = true;
idsystem->Error("recursive error after: %s", com_errorMessage);
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/framework/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3726,7 +3726,7 @@ void idFileSystemLocal::Shutdown(bool closemfp) {
cmdSystem->RemoveCommand("fs_restart");
}

if (fs_missing->integer && missingFiles) {
if(fs_missing->integer && missingFiles) {
fclose(missingFiles);
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/engine/platform/Windows/systemWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,11 @@ void idSystemLocal::PlatformInit(void) {
}

#endif

#if defined (_WIN32) && defined (_DEBUG)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF |
_CRTDBG_CHECK_ALWAYS_DF);
#endif
}

/*
Expand Down
14 changes: 7 additions & 7 deletions src/engine/platform/systemLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@

int main(int argc, char **argv) {
std::string dynName;
#if defined (_WIN32)
dynName = "engine.AMD64.dll";
#elif defined (__LINUX__)
dynName = "./engine.x86_64.so";
#else
dynName = "./engine.x86_64.dylib";
#endif
#if defined (_WIN32)
dynName = "engine.AMD64.dll";
#elif defined (__LINUX__)
dynName = "./engine.x86_64.so";
#else
dynName = "./engine.x86_64.dylib";
#endif
const std::string engineExportName = "engineMain";

SDL_Init(0);
Expand Down
2 changes: 1 addition & 1 deletion src/engine/server/serverMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void idServerMainSystemLocal::MasterGameCompleteStatus(void) {

// send to group masters
for(i = 0 ; i < MAX_MASTER_SERVERS ; i++) {
if (!sv_master[i] || !sv_master[i]->string[0]) {
if(!sv_master[i] || !sv_master[i]->string[0]) {
continue;
}

Expand Down

0 comments on commit c6057f1

Please sign in to comment.