mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: Detection of non-standard exit (supressing leaks detection)
git-svn-id: svn://ultimatepp.org/upp/trunk@13509 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a04da0e3ab
commit
583dc7ddd9
2 changed files with 9 additions and 0 deletions
|
|
@ -337,6 +337,8 @@ void Exit(int code)
|
|||
throw ExitExc();
|
||||
}
|
||||
|
||||
bool AppNormalExit;
|
||||
|
||||
void AppExecute__(void (*app)())
|
||||
{
|
||||
try {
|
||||
|
|
@ -345,6 +347,7 @@ void AppExecute__(void (*app)())
|
|||
catch(ExitExc) {
|
||||
return;
|
||||
}
|
||||
AppNormalExit = true;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ int sMemDiagInitCount;
|
|||
|
||||
namespace Upp {
|
||||
|
||||
extern bool AppNormalExit;
|
||||
|
||||
#if defined(UPP_HEAP)
|
||||
|
||||
#include "HeapImp.h"
|
||||
|
|
@ -192,6 +194,10 @@ void MemoryDumpLeaks()
|
|||
{
|
||||
if(PanicMode)
|
||||
return;
|
||||
if(!AppNormalExit) {
|
||||
VppLog() << "Application was terminated in a non-standard way (e.g. exit(x) call or Ctrl+C)\n";
|
||||
return;
|
||||
}
|
||||
#ifndef PLATFORM_POSIX
|
||||
if(s_ignoreleaks)
|
||||
Panic("Ignore leaks Begin/End mismatch!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue