From 2fad59f296a07534a7664296a020285e63a538e1 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Oct 2017 15:08:31 +0200 Subject: [PATCH] Changed: Added more memory leaks checks --HG-- branch : develop --- .../nel/src/3d/driver/direct3d/driver_direct3d.cpp | 4 ++++ code/nel/src/3d/driver/direct3d/driver_direct3d.h | 11 ++++++++++- .../3d/driver/direct3d/driver_direct3d_index.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_inputs.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_light.cpp | 4 ++++ .../driver/direct3d/driver_direct3d_material.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_matrix.cpp | 4 ++++ .../direct3d/driver_direct3d_pixel_program.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_profile.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_render.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_shader.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_texture.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_uniform.cpp | 4 ++++ .../3d/driver/direct3d/driver_direct3d_vertex.cpp | 4 ++++ .../direct3d/driver_direct3d_vertex_program.cpp | 4 ++++ code/nel/src/georges/form.cpp | 4 ++++ code/nel/src/georges/form_dfn.cpp | 4 ++++ code/nel/src/georges/form_elm.cpp | 4 ++++ code/nel/src/georges/form_loader.cpp | 4 ++++ code/nel/src/georges/header.cpp | 4 ++++ code/nel/src/georges/stdgeorges.h | 12 ++++++++++++ code/nel/src/georges/type.cpp | 4 ++++ code/nel/src/sound/driver/dsound/buffer_dsound.cpp | 4 ++++ .../src/sound/driver/dsound/listener_dsound.cpp | 3 +++ .../sound/driver/dsound/sound_driver_dsound.cpp | 3 +++ code/nel/src/sound/driver/dsound/source_dsound.cpp | 3 +++ code/nel/src/sound/driver/dsound/stddsound.h | 11 +++++++++++ code/nel/src/sound/driver/fmod/buffer_fmod.cpp | 4 ++++ code/nel/src/sound/driver/fmod/listener_fmod.cpp | 3 +++ .../src/sound/driver/fmod/music_channel_fmod.cpp | 4 ++++ .../src/sound/driver/fmod/sound_driver_fmod.cpp | 4 ++++ code/nel/src/sound/driver/fmod/source_fmod.cpp | 3 +++ code/nel/src/sound/driver/fmod/stdfmod.h | 12 ++++++++++++ code/nel/src/sound/driver/openal/buffer_al.cpp | 4 ++++ code/nel/src/sound/driver/openal/effect_al.cpp | 4 ++++ code/nel/src/sound/driver/openal/listener_al.cpp | 4 ++++ .../src/sound/driver/openal/sound_driver_al.cpp | 4 ++++ code/nel/src/sound/driver/openal/source_al.cpp | 4 ++++ .../nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/buffer_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/effect_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/listener_xaudio2.cpp | 4 ++++ .../sound/driver/xaudio2/sound_driver_xaudio2.cpp | 4 ++++ .../src/sound/driver/xaudio2/source_xaudio2.cpp | 4 ++++ code/ryzom/client/src/actions.cpp | 4 ++++ code/ryzom/client/src/actions_client.cpp | 3 +++ code/ryzom/client/src/animation.cpp | 3 +++ code/ryzom/client/src/animation_fx.cpp | 4 ++++ code/ryzom/client/src/animation_fx_id_array.cpp | 4 ++++ code/ryzom/client/src/animation_fx_misc.cpp | 4 ++++ code/ryzom/client/src/animation_misc.cpp | 3 +++ code/ryzom/client/src/animation_set.cpp | 4 ++++ code/ryzom/client/src/animation_state.cpp | 4 ++++ code/ryzom/client/src/app_bundle_utils.cpp | 4 ++++ code/ryzom/client/src/attached_fx.cpp | 4 ++++ code/ryzom/client/src/attack_list.cpp | 3 +++ code/ryzom/client/src/auto_anim.cpp | 3 +++ code/ryzom/client/src/behaviour_context.cpp | 4 ++++ code/ryzom/client/src/bg_downloader_access.cpp | 4 ++++ code/ryzom/client/src/browse_faq.cpp | 4 ++++ code/ryzom/client/src/camera.cpp | 4 ++++ code/ryzom/client/src/character_cl.cpp | 7 +++---- code/ryzom/client/src/commands.cpp | 3 +++ code/ryzom/client/src/http_client_curl.cpp | 4 ++++ code/ryzom/client/src/r2/auto_group.cpp | 4 ++++ code/ryzom/client/src/r2/config_var.cpp | 3 +++ code/ryzom/client/src/r2/displayer_base.cpp | 4 ++++ code/ryzom/client/src/r2/displayer_lua.cpp | 4 ++++ code/ryzom/client/src/r2/displayer_visual.cpp | 4 ++++ .../src/r2/displayer_visual_activity_sequence.cpp | 3 +++ .../client/src/r2/displayer_visual_entity.cpp | 4 ++++ .../ryzom/client/src/r2/displayer_visual_group.cpp | 4 ++++ code/ryzom/client/src/r2/displayer_visual_road.cpp | 3 +++ .../ryzom/client/src/r2/displayer_visual_shape.cpp | 3 +++ code/ryzom/client/src/r2/dmc/action_historic.cpp | 4 ++++ .../client/src/r2/dmc/client_edition_module.cpp | 3 +++ code/ryzom/client/src/r2/dmc/com_lua_module.cpp | 3 +++ code/ryzom/client/src/r2/dmc/dmc.cpp | 3 +++ code/ryzom/client/src/r2/dmc/palette.cpp | 4 ++++ code/ryzom/client/src/r2/dmc/property_accessor.cpp | 5 +++++ code/ryzom/client/src/r2/editor.cpp | 12 ++++++++++++ .../client/src/r2/entity_custom_select_box.cpp | 4 ++++ code/ryzom/client/src/r2/entity_sorter.cpp | 4 ++++ code/ryzom/client/src/r2/instance.cpp | 3 +++ code/ryzom/client/src/r2/island_collision.cpp | 4 ++++ code/ryzom/client/src/r2/lua_event_forwarder.cpp | 3 +++ code/ryzom/client/src/r2/mesh_array.cpp | 3 +++ code/ryzom/client/src/r2/npc_editor.cpp | 4 ++++ code/ryzom/client/src/r2/object_factory_client.cpp | 14 ++++++++++++++ code/ryzom/client/src/r2/palette_node.cpp | 3 +++ code/ryzom/client/src/r2/prim_render.cpp | 3 +++ code/ryzom/client/src/r2/r2_config.cpp | 3 +++ code/ryzom/client/src/r2/r2_lua.cpp | 4 ++++ code/ryzom/client/src/r2/tool.cpp | 4 ++++ code/ryzom/client/src/r2/tool_choose_pos.cpp | 4 ++++ code/ryzom/client/src/r2/tool_choose_pos_lua.cpp | 4 ++++ code/ryzom/client/src/r2/tool_create_entity.cpp | 4 ++++ code/ryzom/client/src/r2/tool_draw_prim.cpp | 3 +++ .../ryzom/client/src/r2/tool_maintained_action.cpp | 4 ++++ code/ryzom/client/src/r2/tool_new_vertex.cpp | 4 ++++ code/ryzom/client/src/r2/tool_pick.cpp | 3 +++ code/ryzom/client/src/r2/tool_select_move.cpp | 3 +++ code/ryzom/client/src/r2/tool_select_rotate.cpp | 3 +++ code/ryzom/client/src/r2/verbose_clock.cpp | 4 ++++ code/ryzom/client/src/stdpch.h | 12 ++++++++++++ 105 files changed, 447 insertions(+), 5 deletions(-) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 5bd0e2cbf..be7a74722 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -32,6 +32,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index c497230aa..a4d9dbaeb 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -480,12 +480,21 @@ public: virtual ~CStateRecord() {} // use STL allocator for fast alloc. this works because objects are small ( < 128 bytes) void *operator new(size_t size) { return CStateRecord::Allocator.allocate(size); } + void *operator new(size_t size, int /* blockUse */, char const * /* fileName */, int /* lineNumber */) + { + // TODO: add memory leaks detector + return CStateRecord::Allocator.allocate(size); + } void operator delete(void *block) { CStateRecord::Allocator.deallocate((uint8 *) block, 1); } + void operator delete(void *block, int /* blockUse */, char const* /* fileName */, int /* lineNumber */) + { + // TODO: add memory leaks detector + CStateRecord::Allocator.deallocate((uint8 *)block, 1); + } static std::allocator Allocator; }; - // record of a single .fx pass class CFXPassRecord { diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp index dfdc48670..d7ee84303 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_index.cpp @@ -25,6 +25,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp index f754b6357..d26741faf 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp @@ -17,6 +17,10 @@ #include "stddirect3d.h" #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp index d3bb62e64..f68caab3a 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp index cc54d6305..e6622f61d 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -27,6 +27,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp index c5b479de0..6e7520fb7 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp index e0a2cd4a4..7d79eb1a7 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_pixel_program.cpp @@ -29,6 +29,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp index 4ff29481c..b574fff54 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_profile.cpp @@ -19,6 +19,10 @@ #include "driver_direct3d.h" #include "nel/misc/hierarchical_timer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp index 939dc1dc9..6b9d2ce0c 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp @@ -27,6 +27,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp index 6f48cc2a4..3f11f8bce 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp @@ -20,6 +20,10 @@ #include "nel/misc/path.h" #include "nel/misc/file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp index d9ba5a526..a10732c64 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp index e44780e89..a936d5b46 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_uniform.cpp @@ -18,6 +18,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp index 2b7fa8fa9..ba726fcc9 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp @@ -26,6 +26,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp index 69ae49c4f..265468125 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp @@ -18,6 +18,10 @@ #include "driver_direct3d.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index 22ed15a2e..f5cbcc3a1 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -24,6 +24,10 @@ #include "nel/georges/form.h" #include "nel/georges/form_loader.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLGEORGES diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index 3f271b976..629c17f86 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -24,6 +24,10 @@ #include "nel/georges/form_loader.h" #include "nel/georges/form_elm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index a28fe2e9c..48368cc38 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -25,6 +25,10 @@ #include "nel/georges/form_loader.h" #include "nel/georges/type.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/georges/form_loader.cpp b/code/nel/src/georges/form_loader.cpp index b56ed23ef..877c587ed 100644 --- a/code/nel/src/georges/form_loader.cpp +++ b/code/nel/src/georges/form_loader.cpp @@ -27,6 +27,10 @@ #include "nel/georges/form.h" #include "nel/georges/form_dfn.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/georges/header.cpp b/code/nel/src/georges/header.cpp index f814d5802..40617e6d5 100644 --- a/code/nel/src/georges/header.cpp +++ b/code/nel/src/georges/header.cpp @@ -22,6 +22,10 @@ #include "nel/georges/header.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLGEORGES diff --git a/code/nel/src/georges/stdgeorges.h b/code/nel/src/georges/stdgeorges.h index a11169d27..fa0bf0819 100644 --- a/code/nel/src/georges/stdgeorges.h +++ b/code/nel/src/georges/stdgeorges.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDGEORGES_H +#define STDGEORGES_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include "nel/misc/types_nl.h" #include #include @@ -27,3 +37,5 @@ // Include from libxml2 #include + +#endif diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index cc3c44d6e..0dd2b9457 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -27,6 +27,10 @@ #include "nel/georges/form_loader.h" #include "nel/georges/type.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/dsound/buffer_dsound.cpp b/code/nel/src/sound/driver/dsound/buffer_dsound.cpp index 53fa8dcec..72423bba7 100644 --- a/code/nel/src/sound/driver/dsound/buffer_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/buffer_dsound.cpp @@ -23,6 +23,10 @@ #include #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/dsound/listener_dsound.cpp b/code/nel/src/sound/driver/dsound/listener_dsound.cpp index 3bed4f821..d8c81b58b 100644 --- a/code/nel/src/sound/driver/dsound/listener_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/listener_dsound.cpp @@ -18,6 +18,9 @@ #include "listener_dsound.h" #include "sound_driver_dsound.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp b/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp index 986993c49..d95b80ca0 100644 --- a/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp @@ -31,6 +31,9 @@ #include "sound_driver_dsound.h" #include "listener_dsound.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/dsound/source_dsound.cpp b/code/nel/src/sound/driver/dsound/source_dsound.cpp index c3bff3289..b80d03590 100644 --- a/code/nel/src/sound/driver/dsound/source_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/source_dsound.cpp @@ -21,6 +21,9 @@ #include "buffer_dsound.h" #include "listener_dsound.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/dsound/stddsound.h b/code/nel/src/sound/driver/dsound/stddsound.h index f550e8150..cb953e630 100644 --- a/code/nel/src/sound/driver/dsound/stddsound.h +++ b/code/nel/src/sound/driver/dsound/stddsound.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDDSOUND_H +#define STDDSOUND_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include "nel/misc/types_nl.h" #define EAX_AVAILABLE 0 @@ -44,4 +54,5 @@ #include "nel/sound/driver/source.h" #include "nel/sound/driver/listener.h" +#endif /* end of file */ diff --git a/code/nel/src/sound/driver/fmod/buffer_fmod.cpp b/code/nel/src/sound/driver/fmod/buffer_fmod.cpp index 69081b013..edba0bec2 100644 --- a/code/nel/src/sound/driver/fmod/buffer_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/buffer_fmod.cpp @@ -25,6 +25,10 @@ # include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/fmod/listener_fmod.cpp b/code/nel/src/sound/driver/fmod/listener_fmod.cpp index ad308c937..776a23d70 100644 --- a/code/nel/src/sound/driver/fmod/listener_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/listener_fmod.cpp @@ -18,6 +18,9 @@ #include "listener_fmod.h" #include "sound_driver_fmod.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp b/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp index 3640869b6..9abfd1006 100644 --- a/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/music_channel_fmod.cpp @@ -18,6 +18,10 @@ #include "music_channel_fmod.h" #include "sound_driver_fmod.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp b/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp index 07455b963..d98aa600f 100644 --- a/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp @@ -26,6 +26,10 @@ #include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/fmod/source_fmod.cpp b/code/nel/src/sound/driver/fmod/source_fmod.cpp index 6026ce2f5..1224d647d 100644 --- a/code/nel/src/sound/driver/fmod/source_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/source_fmod.cpp @@ -21,6 +21,9 @@ #include "buffer_fmod.h" #include "listener_fmod.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/driver/fmod/stdfmod.h b/code/nel/src/sound/driver/fmod/stdfmod.h index afb1af3f1..4274adfe3 100644 --- a/code/nel/src/sound/driver/fmod/stdfmod.h +++ b/code/nel/src/sound/driver/fmod/stdfmod.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDFMOD_H +#define STDFMOD_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include #ifdef NL_OS_WINDOWS @@ -42,4 +52,6 @@ #include "nel/sound/driver/source.h" #include "nel/sound/driver/listener.h" +#endif + /* end of file */ diff --git a/code/nel/src/sound/driver/openal/buffer_al.cpp b/code/nel/src/sound/driver/openal/buffer_al.cpp index 352128c3e..ae0054096 100644 --- a/code/nel/src/sound/driver/openal/buffer_al.cpp +++ b/code/nel/src/sound/driver/openal/buffer_al.cpp @@ -18,6 +18,10 @@ #include "sound_driver_al.h" #include "buffer_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLSOUND diff --git a/code/nel/src/sound/driver/openal/effect_al.cpp b/code/nel/src/sound/driver/openal/effect_al.cpp index 0eec97756..9a09ba7ac 100644 --- a/code/nel/src/sound/driver/openal/effect_al.cpp +++ b/code/nel/src/sound/driver/openal/effect_al.cpp @@ -19,6 +19,10 @@ #include "effect_al.h" #include "sound_driver_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; // using namespace NLMISC; diff --git a/code/nel/src/sound/driver/openal/listener_al.cpp b/code/nel/src/sound/driver/openal/listener_al.cpp index a79e551b6..f39f0f18f 100644 --- a/code/nel/src/sound/driver/openal/listener_al.cpp +++ b/code/nel/src/sound/driver/openal/listener_al.cpp @@ -18,6 +18,10 @@ #include "listener_al.h" #include "sound_driver_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace NLSOUND { diff --git a/code/nel/src/sound/driver/openal/sound_driver_al.cpp b/code/nel/src/sound/driver/openal/sound_driver_al.cpp index ab9574483..d237f533a 100644 --- a/code/nel/src/sound/driver/openal/sound_driver_al.cpp +++ b/code/nel/src/sound/driver/openal/sound_driver_al.cpp @@ -22,6 +22,10 @@ #include "ext_al.h" #include "effect_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/openal/source_al.cpp b/code/nel/src/sound/driver/openal/source_al.cpp index c13db52af..825d9f1e9 100644 --- a/code/nel/src/sound/driver/openal/source_al.cpp +++ b/code/nel/src/sound/driver/openal/source_al.cpp @@ -22,6 +22,10 @@ #include "source_al.h" #include "ext_al.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // #define NLSOUND_DEBUG_GAIN using namespace std; diff --git a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp index 2db913268..e70fec076 100644 --- a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.cpp @@ -20,6 +20,10 @@ #include "buffer_xaudio2.h" #include "adpcm_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; // using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp index 106d565f9..acdb95ab4 100644 --- a/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/buffer_xaudio2.cpp @@ -20,6 +20,10 @@ #include "buffer_xaudio2.h" #include "sound_driver_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp index 5c1f58722..ac3814226 100644 --- a/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/effect_xaudio2.cpp @@ -21,6 +21,10 @@ #include "listener_xaudio2.h" #include "effect_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp index 10b7e7e48..c6b364046 100644 --- a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp @@ -20,6 +20,10 @@ #include "sound_driver_xaudio2.h" #include "listener_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp index 529954006..992f6c66d 100644 --- a/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp @@ -22,6 +22,10 @@ #include "effect_xaudio2.h" #include "sound_driver_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp index 021935e50..26566612c 100644 --- a/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/source_xaudio2.cpp @@ -26,6 +26,10 @@ #include "effect_xaudio2.h" #include "source_xaudio2.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/actions.cpp b/code/ryzom/client/src/actions.cpp index 6b9a3649b..7aeaee537 100644 --- a/code/ryzom/client/src/actions.cpp +++ b/code/ryzom/client/src/actions.cpp @@ -22,6 +22,10 @@ #include "events_listener.h" #include "interface_v3/interface_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/actions_client.cpp b/code/ryzom/client/src/actions_client.cpp index a538afd50..0f9eabad1 100644 --- a/code/ryzom/client/src/actions_client.cpp +++ b/code/ryzom/client/src/actions_client.cpp @@ -28,6 +28,9 @@ #include "actions_client.h" #include "interface_v3/input_handler_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/animation.cpp b/code/ryzom/client/src/animation.cpp index 323405528..5968f6c55 100644 --- a/code/ryzom/client/src/animation.cpp +++ b/code/ryzom/client/src/animation.cpp @@ -35,6 +35,9 @@ #include "client_cfg.h" #include "entity_animation_manager.h" // \todo GUIGUI : added to recompile animations at loading (to do better ?). +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/animation_fx.cpp b/code/ryzom/client/src/animation_fx.cpp index 7be1a79a9..8f716d64e 100644 --- a/code/ryzom/client/src/animation_fx.cpp +++ b/code/ryzom/client/src/animation_fx.cpp @@ -27,6 +27,10 @@ #include "nel/3d/u_scene.h" #include "client_sheets/animation_fx_set_sheet.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NL3D::UScene *Scene; diff --git a/code/ryzom/client/src/animation_fx_id_array.cpp b/code/ryzom/client/src/animation_fx_id_array.cpp index 828ba2a7b..b3c07bbd7 100644 --- a/code/ryzom/client/src/animation_fx_id_array.cpp +++ b/code/ryzom/client/src/animation_fx_id_array.cpp @@ -23,6 +23,10 @@ // #include "nel/3d/u_scene.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NL3D::UScene *Scene; // ********************************************************************* diff --git a/code/ryzom/client/src/animation_fx_misc.cpp b/code/ryzom/client/src/animation_fx_misc.cpp index 9bfb3ffcd..45ee764ba 100644 --- a/code/ryzom/client/src/animation_fx_misc.cpp +++ b/code/ryzom/client/src/animation_fx_misc.cpp @@ -20,4 +20,8 @@ #include "animation_fx_misc.h" #include "animation_fx_id_array.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + CAnimationFXIDArray AnimFXMisc; diff --git a/code/ryzom/client/src/animation_misc.cpp b/code/ryzom/client/src/animation_misc.cpp index d9bf60816..60b13c83c 100644 --- a/code/ryzom/client/src/animation_misc.cpp +++ b/code/ryzom/client/src/animation_misc.cpp @@ -27,6 +27,9 @@ // 3d #include "nel/3d/u_track.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/animation_set.cpp b/code/ryzom/client/src/animation_set.cpp index 52bead6a1..5e93bc25b 100644 --- a/code/ryzom/client/src/animation_set.cpp +++ b/code/ryzom/client/src/animation_set.cpp @@ -33,6 +33,10 @@ #include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_loader.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/animation_state.cpp b/code/ryzom/client/src/animation_state.cpp index 8254d68b4..82aa27a54 100644 --- a/code/ryzom/client/src/animation_state.cpp +++ b/code/ryzom/client/src/animation_state.cpp @@ -30,6 +30,10 @@ // Georges #include "nel/georges/u_form_elm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/app_bundle_utils.cpp b/code/ryzom/client/src/app_bundle_utils.cpp index 42d1b61bc..4c4753c4f 100644 --- a/code/ryzom/client/src/app_bundle_utils.cpp +++ b/code/ryzom/client/src/app_bundle_utils.cpp @@ -21,6 +21,10 @@ #include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + std::string getAppBundlePath() { static std::string s_cachedPathToBundle; diff --git a/code/ryzom/client/src/attached_fx.cpp b/code/ryzom/client/src/attached_fx.cpp index 0f520f689..7a7b0cd4a 100644 --- a/code/ryzom/client/src/attached_fx.cpp +++ b/code/ryzom/client/src/attached_fx.cpp @@ -27,6 +27,10 @@ #include "time_client.h" #include "fx_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NL3D::UScene *Scene; diff --git a/code/ryzom/client/src/attack_list.cpp b/code/ryzom/client/src/attack_list.cpp index 494ba2e53..c748e5832 100644 --- a/code/ryzom/client/src/attack_list.cpp +++ b/code/ryzom/client/src/attack_list.cpp @@ -29,6 +29,9 @@ // #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif H_AUTO_DECL(RZ_AttackList) diff --git a/code/ryzom/client/src/auto_anim.cpp b/code/ryzom/client/src/auto_anim.cpp index 5cc21305a..9676742bb 100644 --- a/code/ryzom/client/src/auto_anim.cpp +++ b/code/ryzom/client/src/auto_anim.cpp @@ -33,6 +33,9 @@ #include #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/behaviour_context.cpp b/code/ryzom/client/src/behaviour_context.cpp index a8df81d9f..e8fb2d6ea 100644 --- a/code/ryzom/client/src/behaviour_context.cpp +++ b/code/ryzom/client/src/behaviour_context.cpp @@ -19,6 +19,10 @@ #include "stdpch.h" #include "behaviour_context.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + CBehaviourContext::CBehaviourContext() { } diff --git a/code/ryzom/client/src/bg_downloader_access.cpp b/code/ryzom/client/src/bg_downloader_access.cpp index 1a479849e..426a4176b 100644 --- a/code/ryzom/client/src/bg_downloader_access.cpp +++ b/code/ryzom/client/src/bg_downloader_access.cpp @@ -31,6 +31,10 @@ #include "nel/misc/win_thread.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace BGDownloader; using namespace NLMISC; diff --git a/code/ryzom/client/src/browse_faq.cpp b/code/ryzom/client/src/browse_faq.cpp index ec0d7906d..f56ed0baf 100644 --- a/code/ryzom/client/src/browse_faq.cpp +++ b/code/ryzom/client/src/browse_faq.cpp @@ -17,6 +17,10 @@ #include "stdpch.h" #include "browse_faq.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; void browseFAQ(NLMISC::CConfigFile &cf) diff --git a/code/ryzom/client/src/camera.cpp b/code/ryzom/client/src/camera.cpp index 5f388fb28..904a2db49 100644 --- a/code/ryzom/client/src/camera.cpp +++ b/code/ryzom/client/src/camera.cpp @@ -22,6 +22,10 @@ #include "global.h" #include "misc.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index e73592acd..a473b4b80 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -111,6 +111,9 @@ #include "game_share/range_weapon_type.h" // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif //////////// // DEFINE // @@ -137,10 +140,6 @@ using namespace std; using namespace MBEHAV; using namespace CLFECOMMON; -#ifdef DEBUG_NEW -#define new DEBUG_NEW -#endif - //////////// // EXTERN // //////////// diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 8ba5f769f..7c33edb90 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -107,6 +107,9 @@ // to desactive some commands // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif //////////////// diff --git a/code/ryzom/client/src/http_client_curl.cpp b/code/ryzom/client/src/http_client_curl.cpp index fcead3e5e..9b8bdb6ae 100644 --- a/code/ryzom/client/src/http_client_curl.cpp +++ b/code/ryzom/client/src/http_client_curl.cpp @@ -26,6 +26,10 @@ using namespace NLMISC; using namespace NLNET; using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #define _Curl (CURL *)_CurlStruct diff --git a/code/ryzom/client/src/r2/auto_group.cpp b/code/ryzom/client/src/r2/auto_group.cpp index eeefbd7de..7372d6e48 100644 --- a/code/ryzom/client/src/r2/auto_group.cpp +++ b/code/ryzom/client/src/r2/auto_group.cpp @@ -21,6 +21,10 @@ // #include "nel/misc/i18n.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/config_var.cpp b/code/ryzom/client/src/r2/config_var.cpp index bb9655ba9..4706acfb8 100644 --- a/code/ryzom/client/src/r2/config_var.cpp +++ b/code/ryzom/client/src/r2/config_var.cpp @@ -17,6 +17,9 @@ #include "stdpch.h" #include "config_var.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace R2 diff --git a/code/ryzom/client/src/r2/displayer_base.cpp b/code/ryzom/client/src/r2/displayer_base.cpp index a3ae09621..1864d0e95 100644 --- a/code/ryzom/client/src/r2/displayer_base.cpp +++ b/code/ryzom/client/src/r2/displayer_base.cpp @@ -23,6 +23,10 @@ #include "nel/gui/lua_ihm.h" #include "nel/gui/interface_element.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/displayer_lua.cpp b/code/ryzom/client/src/r2/displayer_lua.cpp index 100dadc8d..2f17efb1a 100644 --- a/code/ryzom/client/src/r2/displayer_lua.cpp +++ b/code/ryzom/client/src/r2/displayer_lua.cpp @@ -20,6 +20,10 @@ #include "../interface_v3/lua_ihm_ryzom.h" #include "editor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/displayer_visual.cpp b/code/ryzom/client/src/r2/displayer_visual.cpp index aec4ea1fe..76c4270a3 100644 --- a/code/ryzom/client/src/r2/displayer_visual.cpp +++ b/code/ryzom/client/src/r2/displayer_visual.cpp @@ -33,6 +33,10 @@ // #include "r2_config.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; extern uint SkipFrame; diff --git a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp index 1d24b266c..6fd17b470 100644 --- a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp @@ -23,6 +23,9 @@ #include "../interface_v3/interface_manager.h" #include "nel/gui/view_renderer.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/displayer_visual_entity.cpp b/code/ryzom/client/src/r2/displayer_visual_entity.cpp index 238b4bf5c..d906d3d1e 100644 --- a/code/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -58,6 +58,10 @@ // #include "../sheet_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/displayer_visual_group.cpp b/code/ryzom/client/src/r2/displayer_visual_group.cpp index 2f10f9512..3784879cc 100644 --- a/code/ryzom/client/src/r2/displayer_visual_group.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_group.cpp @@ -38,6 +38,10 @@ #include "../time_client.h" // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + class CGroupMap; using namespace R2; diff --git a/code/ryzom/client/src/r2/displayer_visual_road.cpp b/code/ryzom/client/src/r2/displayer_visual_road.cpp index dc9f8d9f2..629ca4729 100644 --- a/code/ryzom/client/src/r2/displayer_visual_road.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_road.cpp @@ -22,6 +22,9 @@ #include "../global.h" // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/displayer_visual_shape.cpp b/code/ryzom/client/src/r2/displayer_visual_shape.cpp index d676f916a..9d7bba6ba 100644 --- a/code/ryzom/client/src/r2/displayer_visual_shape.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_shape.cpp @@ -33,6 +33,9 @@ #include "nel/3d/u_visual_collision_manager.h" #include "nel/3d/u_visual_collision_entity.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/dmc/action_historic.cpp b/code/ryzom/client/src/r2/dmc/action_historic.cpp index 4ad984778..e7a32cc62 100644 --- a/code/ryzom/client/src/r2/dmc/action_historic.cpp +++ b/code/ryzom/client/src/r2/dmc/action_historic.cpp @@ -21,6 +21,10 @@ #include "../editor.h" #include "nel/gui/lua_ihm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp index 649996256..a3da447dc 100644 --- a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp +++ b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp @@ -68,6 +68,9 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace std; diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index d3f5b1a65..930e06051 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -58,6 +58,9 @@ using namespace NLGUI; using namespace NLMISC; using namespace R2; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif std::map CComLuaModule::_Instance; diff --git a/code/ryzom/client/src/r2/dmc/dmc.cpp b/code/ryzom/client/src/r2/dmc/dmc.cpp index f04feccf4..e03078009 100644 --- a/code/ryzom/client/src/r2/dmc/dmc.cpp +++ b/code/ryzom/client/src/r2/dmc/dmc.cpp @@ -45,6 +45,9 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLNET; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/dmc/palette.cpp b/code/ryzom/client/src/r2/dmc/palette.cpp index e0fb35b30..2ef0eb630 100644 --- a/code/ryzom/client/src/r2/dmc/palette.cpp +++ b/code/ryzom/client/src/r2/dmc/palette.cpp @@ -21,6 +21,10 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace R2; namespace R2 diff --git a/code/ryzom/client/src/r2/dmc/property_accessor.cpp b/code/ryzom/client/src/r2/dmc/property_accessor.cpp index a7037201a..3a8da702a 100644 --- a/code/ryzom/client/src/r2/dmc/property_accessor.cpp +++ b/code/ryzom/client/src/r2/dmc/property_accessor.cpp @@ -21,6 +21,11 @@ #include "game_share/object.h" #include + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace R2; diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index a5b889961..d0c169c97 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -115,6 +115,9 @@ using namespace NLGUI; #include "../far_tp.h" #include "nel/gui/lua_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace NLNET; @@ -1628,8 +1631,17 @@ int CEditor::luaEnumInstances(CLuaState &ls) mt.setValue("__gc", CLuaObject(ls)); // void *newIter = ls.newUserData(sizeof(CInstanceEnumerator)); + +#ifdef new +#undef new +#endif + CInstanceEnumerator *ie = new (newIter) CInstanceEnumerator; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + ie->InstMap = &getEditor()._InstancesByDispName[classIndex]; ie->Current = ie->InstMap->begin(); mt.push(); diff --git a/code/ryzom/client/src/r2/entity_custom_select_box.cpp b/code/ryzom/client/src/r2/entity_custom_select_box.cpp index bcd757dc7..c426ad30c 100644 --- a/code/ryzom/client/src/r2/entity_custom_select_box.cpp +++ b/code/ryzom/client/src/r2/entity_custom_select_box.cpp @@ -21,6 +21,10 @@ // #include "nel/misc/vector.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/r2/entity_sorter.cpp b/code/ryzom/client/src/r2/entity_sorter.cpp index aee488ff6..201e65e03 100644 --- a/code/ryzom/client/src/r2/entity_sorter.cpp +++ b/code/ryzom/client/src/r2/entity_sorter.cpp @@ -20,6 +20,10 @@ #include "../user_entity.h" #include "../time_client.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/r2/instance.cpp b/code/ryzom/client/src/r2/instance.cpp index 597e58d5d..f97719b0a 100644 --- a/code/ryzom/client/src/r2/instance.cpp +++ b/code/ryzom/client/src/r2/instance.cpp @@ -30,6 +30,9 @@ // #include "displayer_visual_entity.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/island_collision.cpp b/code/ryzom/client/src/r2/island_collision.cpp index fbc5a14ba..74829a17e 100644 --- a/code/ryzom/client/src/r2/island_collision.cpp +++ b/code/ryzom/client/src/r2/island_collision.cpp @@ -33,6 +33,10 @@ // #include "nel/3d/texture_file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern CContinentManager ContinentMngr; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/lua_event_forwarder.cpp b/code/ryzom/client/src/r2/lua_event_forwarder.cpp index cfacfaf07..27b1927b4 100644 --- a/code/ryzom/client/src/r2/lua_event_forwarder.cpp +++ b/code/ryzom/client/src/r2/lua_event_forwarder.cpp @@ -18,6 +18,9 @@ #include "lua_event_forwarder.h" #include "nel/gui/lua_object.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace R2 { diff --git a/code/ryzom/client/src/r2/mesh_array.cpp b/code/ryzom/client/src/r2/mesh_array.cpp index 844370d41..661f56937 100644 --- a/code/ryzom/client/src/r2/mesh_array.cpp +++ b/code/ryzom/client/src/r2/mesh_array.cpp @@ -21,6 +21,9 @@ #include "../global.h" #include "../misc.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/r2/npc_editor.cpp b/code/ryzom/client/src/r2/npc_editor.cpp index 5a154acee..a3c7e190d 100644 --- a/code/ryzom/client/src/r2/npc_editor.cpp +++ b/code/ryzom/client/src/r2/npc_editor.cpp @@ -27,6 +27,10 @@ #include "../sheet_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NL3D; using namespace std; diff --git a/code/ryzom/client/src/r2/object_factory_client.cpp b/code/ryzom/client/src/r2/object_factory_client.cpp index 688ec3fcb..f91ed6681 100644 --- a/code/ryzom/client/src/r2/object_factory_client.cpp +++ b/code/ryzom/client/src/r2/object_factory_client.cpp @@ -21,6 +21,10 @@ #include "nel/gui/lua_ihm.h" #include "../interface_v3/lua_ihm_ryzom.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { @@ -319,7 +323,17 @@ void CObjectTableClient::pushOnLuaStack(CLuaState &state, CLuaObject &metatable) nlassert(metatable.isValid()); // return a new refptr on the sub table void *block = state.newUserData(sizeof(TRefPtrConst)); + +#ifdef new +#undef new +#endif + new (block) CObjectTable::TRefPtrConst(this); // create in place + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + metatable.push(); state.setMetaTable(-2); _Ref.pop(state); diff --git a/code/ryzom/client/src/r2/palette_node.cpp b/code/ryzom/client/src/r2/palette_node.cpp index b24c5b6bd..d11eeaefa 100644 --- a/code/ryzom/client/src/r2/palette_node.cpp +++ b/code/ryzom/client/src/r2/palette_node.cpp @@ -18,6 +18,9 @@ #include "palette_node.h" #include "editor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif namespace R2 diff --git a/code/ryzom/client/src/r2/prim_render.cpp b/code/ryzom/client/src/r2/prim_render.cpp index e714b979a..e8b1c23ac 100644 --- a/code/ryzom/client/src/r2/prim_render.cpp +++ b/code/ryzom/client/src/r2/prim_render.cpp @@ -29,6 +29,9 @@ #include "nel/gui/view_renderer.h" #include "../interface_v3/group_map.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NL3D; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/r2_config.cpp b/code/ryzom/client/src/r2/r2_config.cpp index 76fc73b39..47f9d56dd 100644 --- a/code/ryzom/client/src/r2/r2_config.cpp +++ b/code/ryzom/client/src/r2/r2_config.cpp @@ -17,6 +17,9 @@ #include "stdpch.h" #include "r2_config.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/r2_lua.cpp b/code/ryzom/client/src/r2/r2_lua.cpp index efe510aa7..a29636bff 100644 --- a/code/ryzom/client/src/r2/r2_lua.cpp +++ b/code/ryzom/client/src/r2/r2_lua.cpp @@ -21,6 +21,10 @@ #include "stdpch.h" #include "r2_lua.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // stupid function to remove VC6 warnings #ifdef NL_COMP_VC6 void foo_r2_lua_cpp() {} diff --git a/code/ryzom/client/src/r2/tool.cpp b/code/ryzom/client/src/r2/tool.cpp index bcbe7f5ac..2e663a5ec 100644 --- a/code/ryzom/client/src/r2/tool.cpp +++ b/code/ryzom/client/src/r2/tool.cpp @@ -42,6 +42,10 @@ // #include "nel/3d/packed_world.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern NLPACS::UGlobalRetriever *GR; diff --git a/code/ryzom/client/src/r2/tool_choose_pos.cpp b/code/ryzom/client/src/r2/tool_choose_pos.cpp index 64d0b9d7f..ae76fc3bf 100644 --- a/code/ryzom/client/src/r2/tool_choose_pos.cpp +++ b/code/ryzom/client/src/r2/tool_choose_pos.cpp @@ -35,6 +35,10 @@ #include "dmc/idmc.h" #include "r2_config.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLPACS; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp b/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp index 85e1ba03e..5efaaae20 100644 --- a/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp +++ b/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp @@ -21,6 +21,10 @@ // #include "nel/misc/vectord.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLPACS; using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_create_entity.cpp b/code/ryzom/client/src/r2/tool_create_entity.cpp index 7c6af14c5..b6be50bd7 100644 --- a/code/ryzom/client/src/r2/tool_create_entity.cpp +++ b/code/ryzom/client/src/r2/tool_create_entity.cpp @@ -41,6 +41,10 @@ #include "game_share/player_visual_properties.h" #include "game_share/visual_slot_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLPACS; using namespace NLMISC; using namespace std; diff --git a/code/ryzom/client/src/r2/tool_draw_prim.cpp b/code/ryzom/client/src/r2/tool_draw_prim.cpp index fa90ebcc7..da8c41f06 100644 --- a/code/ryzom/client/src/r2/tool_draw_prim.cpp +++ b/code/ryzom/client/src/r2/tool_draw_prim.cpp @@ -34,6 +34,9 @@ // tmp tmp #include "nel/gui/ctrl_quad.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_maintained_action.cpp b/code/ryzom/client/src/r2/tool_maintained_action.cpp index ce68a0b86..ea0adaa93 100644 --- a/code/ryzom/client/src/r2/tool_maintained_action.cpp +++ b/code/ryzom/client/src/r2/tool_maintained_action.cpp @@ -20,6 +20,10 @@ #include "editor.h" #include "../interface_v3/interface_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/client/src/r2/tool_new_vertex.cpp b/code/ryzom/client/src/r2/tool_new_vertex.cpp index e0d722822..6d2443e52 100644 --- a/code/ryzom/client/src/r2/tool_new_vertex.cpp +++ b/code/ryzom/client/src/r2/tool_new_vertex.cpp @@ -23,6 +23,10 @@ // #include "nel/misc/i18n.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/r2/tool_pick.cpp b/code/ryzom/client/src/r2/tool_pick.cpp index 972da9a3c..bb80a6258 100644 --- a/code/ryzom/client/src/r2/tool_pick.cpp +++ b/code/ryzom/client/src/r2/tool_pick.cpp @@ -21,6 +21,9 @@ // #include "nel/gui/lua_ihm.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_select_move.cpp b/code/ryzom/client/src/r2/tool_select_move.cpp index 261e8b49a..f9b9b9a1a 100644 --- a/code/ryzom/client/src/r2/tool_select_move.cpp +++ b/code/ryzom/client/src/r2/tool_select_move.cpp @@ -31,6 +31,9 @@ // #include "nel/misc/matrix.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/tool_select_rotate.cpp b/code/ryzom/client/src/r2/tool_select_rotate.cpp index b6f87e23c..56884a52b 100644 --- a/code/ryzom/client/src/r2/tool_select_rotate.cpp +++ b/code/ryzom/client/src/r2/tool_select_rotate.cpp @@ -28,6 +28,9 @@ #include "displayer_visual.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace NLMISC; diff --git a/code/ryzom/client/src/r2/verbose_clock.cpp b/code/ryzom/client/src/r2/verbose_clock.cpp index cd64cc2b3..23f14a735 100644 --- a/code/ryzom/client/src/r2/verbose_clock.cpp +++ b/code/ryzom/client/src/r2/verbose_clock.cpp @@ -20,6 +20,10 @@ // #include "verbose_clock.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; namespace R2 diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index c017c584b..5b95b65d9 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -14,6 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef RYZOMCLIENT_STDPCH_H +#define RYZOMCLIENT_STDPCH_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif + #include #include @@ -126,3 +136,5 @@ # include # include #endif // NL_OS_WINDOWS + +#endif