Changed: Preliminary memory leaks detection under Windows

This commit is contained in:
kervala 2012-12-08 11:40:34 +01:00
parent 5f3e07f324
commit f8983b2326
18 changed files with 96 additions and 18 deletions

View file

@ -19,6 +19,10 @@
#include "nel/misc/dynloadlib.h" #include "nel/misc/dynloadlib.h"
#include "nel/misc/command.h" #include "nel/misc/command.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -26,6 +26,9 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

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

View file

@ -15,9 +15,10 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/cpu_time_stat.h"
#include "nel/misc/cpu_time_stat.h"
#include "nel/misc/common.h" #include "nel/misc/common.h"
#include "nel/misc/debug.h"
#ifdef NL_OS_UNIX #ifdef NL_OS_UNIX
#include <unistd.h> #include <unistd.h>
@ -27,6 +28,10 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -17,6 +17,11 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/eval_num_expr.h" #include "nel/misc/eval_num_expr.h"
#include "nel/misc/debug.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -15,9 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h" #include "stdmisc.h"
#ifndef NL_OS_WINDOWS
#include <errno.h>
#endif
#include "nel/misc/file.h" #include "nel/misc/file.h"
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
#include "nel/misc/big_file.h" #include "nel/misc/big_file.h"
@ -26,10 +24,18 @@
#include "nel/misc/sstring.h" #include "nel/misc/sstring.h"
#include "nel/misc/xml_pack.h" #include "nel/misc/xml_pack.h"
#ifndef NL_OS_WINDOWS
#include <errno.h>
#endif
using namespace std; using namespace std;
#define NLMISC_DONE_FILE_OPENED 40 #define NLMISC_DONE_FILE_OPENED 40
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/gtk_displayer.h"
#ifdef NL_USE_GTK #ifdef NL_USE_GTK
@ -35,10 +36,12 @@
#include "nel/misc/command.h" #include "nel/misc/command.h"
#include "nel/misc/thread.h" #include "nel/misc/thread.h"
#include "nel/misc/gtk_displayer.h"
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {
// //

View file

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

View file

@ -16,12 +16,16 @@
#include "stdmisc.h" #include "stdmisc.h"
#ifdef NL_OS_WINDOWS
#include "nel/misc/inter_window_msg_queue.h" #include "nel/misc/inter_window_msg_queue.h"
//
#ifdef NL_OS_WINDOWS
#include "nel/misc/mem_stream.h" #include "nel/misc/mem_stream.h"
#include "nel/misc/shared_memory.h" #include "nel/misc/shared_memory.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -22,6 +22,7 @@
#include "nel/misc/mutex.h" #include "nel/misc/mutex.h"
#include "nel/misc/time_nl.h" #include "nel/misc/time_nl.h"
#include "nel/misc/debug.h"
using namespace std; using namespace std;
@ -47,6 +48,9 @@ using namespace std;
#define NOMINMAX #define NOMINMAX
#include <windows.h> #include <windows.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {

View file

@ -17,8 +17,8 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/big_file.h"
#include "nel/misc/path.h" #include "nel/misc/path.h"
#include "nel/misc/big_file.h"
#include "nel/misc/hierarchical_timer.h" #include "nel/misc/hierarchical_timer.h"
#include "nel/misc/progress_callback.h" #include "nel/misc/progress_callback.h"
#include "nel/misc/file.h" #include "nel/misc/file.h"
@ -48,6 +48,10 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {
// //

View file

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

View file

@ -15,7 +15,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/shared_memory.h" #include "nel/misc/shared_memory.h"
#include "nel/misc/debug.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
# define NOMINMAX # define NOMINMAX
@ -28,6 +30,9 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {

View file

@ -16,6 +16,8 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/system_info.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
# define NOMINMAX # define NOMINMAX
# include <windows.h> # include <windows.h>
@ -42,6 +44,10 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {
#ifdef NL_OS_UNIX #ifdef NL_OS_UNIX

View file

@ -17,12 +17,17 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/tds.h" #include "nel/misc/tds.h"
#include "nel/misc/debug.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
# define NOMINMAX # define NOMINMAX
# include <windows.h> # include <windows.h>
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -16,6 +16,10 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/time_nl.h"
#include "nel/misc/sstring.h"
#include "nel/misc/thread.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
# define NOMINMAX # define NOMINMAX
# include <windows.h> # include <windows.h>
@ -29,10 +33,9 @@
#include <mach/mach_time.h> #include <mach/mach_time.h>
#endif #endif
#include "nel/misc/time_nl.h" #ifdef DEBUG_NEW
#include "nel/misc/sstring.h" #define new DEBUG_NEW
#endif
#include <nel/misc/thread.h>
namespace NLMISC namespace NLMISC
{ {

View file

@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/win_displayer.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -33,10 +34,12 @@
#include "nel/misc/thread.h" #include "nel/misc/thread.h"
#include "nel/misc/ucstring.h" #include "nel/misc/ucstring.h"
#include "nel/misc/win_displayer.h"
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {
static CHARFORMAT2 CharFormat; static CHARFORMAT2 CharFormat;

View file

@ -15,16 +15,20 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/win_thread.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
#include "nel/misc/win_thread.h"
#include "nel/misc/path.h" #include "nel/misc/path.h"
#define NOMINMAX #define NOMINMAX
#include <windows.h> #include <windows.h>
#include <typeinfo> #include <typeinfo>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {
CWinThread MainThread ((void*)GetCurrentThread (), GetCurrentThreadId()); CWinThread MainThread ((void*)GetCurrentThread (), GetCurrentThreadId());