Changed: Preliminary memory leaks detection under Windows

This commit is contained in:
kervala 2013-02-08 13:29:17 +01:00
parent 39668984c1
commit dc28573170
10 changed files with 57 additions and 3 deletions

View file

@ -15,9 +15,13 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h"
#include "nel/misc/types_nl.h"
#include "nel/misc/co_task.h"
#include "nel/misc/tds.h"
#include "nel/misc/time_nl.h"
#include "nel/misc/debug.h"
// Flag to use thread instead of coroutine primitives (i.e windows fibers or gcc context)
#ifndef NL_OS_WINDOWS
#define NL_USE_THREAD_COTASK
@ -59,6 +63,10 @@
#endif
#endif //NL_USE_THREAD_COTASK
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

View file

@ -16,6 +16,9 @@
#include "stdmisc.h"
#include "nel/misc/types_nl.h"
#include "nel/misc/common.h"
#ifdef NL_OS_WINDOWS
# define NOMINMAX
# include <windows.h>
@ -68,6 +71,9 @@ extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif // NL_OS_WINDOWS
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../stdmisc.h"
#include "nel/misc/config_file.h"
#include <ctime>
@ -27,6 +28,10 @@
#include "nel/misc/mem_stream.h"
#include "locale.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -15,8 +15,13 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h"
#include "nel/misc/contiguous_block_allocator.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

View file

@ -16,6 +16,9 @@
#include "stdmisc.h"
#include "nel/misc/types_nl.h"
#include "nel/misc/debug.h"
#ifdef HAVE_NELCONFIG_H
# include "nelconfig.h"
#endif // HAVE_NELCONFIG_H
@ -27,6 +30,7 @@
#include "nel/misc/report.h"
#include "nel/misc/path.h"
#include "nel/misc/variable.h"
#include "nel/misc/system_info.h"
#ifdef NL_OS_WINDOWS
# define _WIN32_WINDOWS 0x0410
@ -79,6 +83,9 @@ using namespace std;
// If true, debug system will trap crash even if the application is in debugger
static const bool TrapCrashInDebugger = false;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{
@ -90,7 +97,7 @@ namespace NLMISC
bool DisableNLDebug= false;
NLMISC::CVariablePtr<bool> _DisableNLDebug("nel","DisableNLDebug","Disables generation and output of nldebug logs (no code associated with the log generation is executed)",&DisableNLDebug,true);
static std::string LogPath = "";
static std::string LogPath;
//bool DebugNeedAssert = false;
//bool NoAssert = false;

View file

@ -16,6 +16,7 @@
#include "stdmisc.h"
#include "nel/misc/types_nl.h"
#ifdef NL_OS_WINDOWS
# include <io.h>
@ -49,6 +50,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

View file

@ -15,8 +15,13 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h"
#include "nel/misc/fixed_size_allocator.h"
#include "nel/misc/fixed_size_allocator.h"
#include "nel/misc/debug.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

View file

@ -17,9 +17,13 @@
#include "stdmisc.h"
#include "nel/misc/heap_memory.h"
#include "nel/misc/debug.h"
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

View file

@ -16,6 +16,8 @@
#include "stdmisc.h"
#include "nel/misc/log.h"
#ifdef NL_OS_WINDOWS
# define NOMINMAX
# include <process.h>
@ -31,6 +33,9 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{
@ -430,7 +435,7 @@ void CLog::displayRawString (const char *str)
(*idi)->display( *args, disp );
}
}
TempString = "";
TempString.clear();
unsetPosition();
}

View file

@ -18,6 +18,10 @@
#include "nel/misc/object_arena_allocator.h"
#include "nel/misc/fixed_size_allocator.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{