|
|
@ -2233,31 +2233,35 @@ int main() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
HANDLE hLogFile; |
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
hLogFile = CreateFile(L"assets/memoryleak.txt", GENERIC_WRITE, |
|
|
|
#ifndef __linux__ |
|
|
|
FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, |
|
|
|
HANDLE hLogFile; |
|
|
|
FILE_ATTRIBUTE_NORMAL, NULL); |
|
|
|
hLogFile = CreateFile(L"assets/memoryleak.txt", GENERIC_WRITE, |
|
|
|
_CrtSetReportMode(_CRT_WARN,_CRTDBG_MODE_FILE); |
|
|
|
FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, |
|
|
|
_CrtSetReportFile(_CRT_WARN,hLogFile); |
|
|
|
FILE_ATTRIBUTE_NORMAL, NULL); |
|
|
|
_CrtDumpMemoryLeaks(); |
|
|
|
_CrtSetReportMode(_CRT_WARN,_CRTDBG_MODE_FILE); |
|
|
|
CloseHandle(hLogFile); |
|
|
|
_CrtSetReportFile(_CRT_WARN,hLogFile); |
|
|
|
|
|
|
|
_CrtDumpMemoryLeaks(); |
|
|
|
std::ifstream file("assets/memoryleak.txt"); |
|
|
|
CloseHandle(hLogFile); |
|
|
|
bool leaked=false; |
|
|
|
|
|
|
|
while(file.good()){ |
|
|
|
std::ifstream file("assets/memoryleak.txt"); |
|
|
|
std::string line; |
|
|
|
bool leaked=false; |
|
|
|
std::getline(file,line); |
|
|
|
while(file.good()){ |
|
|
|
if(line.find("AiL\\")!=std::string::npos){ |
|
|
|
std::string line; |
|
|
|
if(!leaked){ |
|
|
|
|
|
|
|
leaked=true; |
|
|
|
|
|
|
|
std::cout<<std::endl<<std::endl<<std::endl<<"Memory leak detected!"<<std::endl; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
std::cout<<line<<std::endl; |
|
|
|
|
|
|
|
std::getline(file,line); |
|
|
|
std::getline(file,line); |
|
|
|
std::cout<<line<<std::endl; |
|
|
|
if(line.find("AiL\\")!=std::string::npos){ |
|
|
|
|
|
|
|
if(!leaked){ |
|
|
|
|
|
|
|
leaked=true; |
|
|
|
|
|
|
|
std::cout<<std::endl<<std::endl<<std::endl<<"Memory leak detected!"<<std::endl; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
std::cout<<line<<std::endl; |
|
|
|
|
|
|
|
std::getline(file,line); |
|
|
|
|
|
|
|
std::cout<<line<<std::endl; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(leaked)ERR("") |
|
|
|
if(leaked)ERR("") |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|