mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 20:22:31 +01:00
- memory leak checker fixed a few issues
This commit is contained in:
parent
1403a3fe44
commit
ae91368a99
@ -68,6 +68,7 @@ void exceptionMessage(const exception &excp) {
|
||||
#if defined(__GNUC__) && !defined(__FreeBSD__) && !defined(BSD)
|
||||
static int getFileAndLine(char *function, void *address, char *file, size_t flen) {
|
||||
int line=-1;
|
||||
if(PlatformExceptionHandler::application_binary != "") {
|
||||
const int maxbufSize = 8094;
|
||||
char buf[maxbufSize+1]="";
|
||||
//char *p=NULL;
|
||||
@ -151,6 +152,7 @@ static int getFileAndLine(char *function, void *address, char *file, size_t flen
|
||||
line = 0;
|
||||
}
|
||||
pclose(f);
|
||||
}
|
||||
|
||||
return line;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
using Shared::Platform::MutexSafeWrapper;
|
||||
|
||||
bool AllocInfo::application_binary_initialized = false;
|
||||
static AllocRegistry memoryLeaks = AllocRegistry::getInstance();
|
||||
//static AllocRegistry memoryLeaks = AllocRegistry::getInstance();
|
||||
|
||||
// =====================================================
|
||||
// class AllocRegistry
|
||||
@ -108,6 +108,11 @@ void AllocRegistry::dump(const char *path) {
|
||||
fprintf(f, "Not monitored allocations: %d, %lu bytes\n", nonMonitoredCount, nonMonitoredBytes);
|
||||
|
||||
fclose(f);
|
||||
|
||||
printf("Memory leak dump summary:\n");
|
||||
printf("Total leaks: %d, %lu bytes\n", leakCount, leakBytes);
|
||||
printf("Total allocations: %d, %lu bytes\n", allocCount, allocBytes);
|
||||
printf("Not monitored allocations: %d, %lu bytes\n", nonMonitoredCount, nonMonitoredBytes);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user