diff --git a/code/nel/src/net/buf_client.cpp b/code/nel/src/net/buf_client.cpp index 350b2d6db..18ce7babf 100644 --- a/code/nel/src/net/buf_client.cpp +++ b/code/nel/src/net/buf_client.cpp @@ -32,6 +32,10 @@ # include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/net/inet_address.cpp b/code/nel/src/net/inet_address.cpp index 093bf8dcb..13ae02c39 100644 --- a/code/nel/src/net/inet_address.cpp +++ b/code/nel/src/net/inet_address.cpp @@ -121,6 +121,10 @@ BOOLEAN IN6_IS_ADDR_UNSPECIFIED(CONST IN6_ADDR *a) using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #ifndef NI_MAXHOST # define NI_MAXHOST 1025 #endif diff --git a/code/nel/src/net/module.cpp b/code/nel/src/net/module.cpp index 73a1c7867..1b5e03bec 100644 --- a/code/nel/src/net/module.cpp +++ b/code/nel/src/net/module.cpp @@ -24,6 +24,10 @@ #include "nel/net/module_gateway.h" #include "nel/net/module_socket.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; using namespace NLNET; diff --git a/code/nel/src/net/stdnet.h b/code/nel/src/net/stdnet.h index 16e87c9f8..6ced991a5 100644 --- a/code/nel/src/net/stdnet.h +++ b/code/nel/src/net/stdnet.h @@ -17,20 +17,11 @@ #ifndef NL_STDNET_H #define NL_STDNET_H -#include "nel/misc/types_nl.h" - -#ifdef NL_OS_WINDOWS -# define WIN32_LEAN_AND_MEAN -# define _WIN32_WINDOWS 0x0500 -# ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0500 -# endif -# ifndef NL_COMP_MINGW -# define WINVER 0x0500 -# define NOMINMAX -# endif -# include -# include +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) #endif #include @@ -55,6 +46,7 @@ #include +#include "nel/misc/types_nl.h" #include "nel/misc/debug.h" #include "nel/misc/common.h" #include "nel/misc/stream.h" @@ -64,4 +56,18 @@ #include "nel/misc/mem_stream.h" #include "nel/misc/hierarchical_timer.h" +#ifdef NL_OS_WINDOWS +# define WIN32_LEAN_AND_MEAN +# define _WIN32_WINDOWS 0x0500 +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# endif +# ifndef NL_COMP_MINGW +# define WINVER 0x0500 +# define NOMINMAX +# endif +# include +# include +#endif + #endif diff --git a/code/nel/src/net/transport_class.cpp b/code/nel/src/net/transport_class.cpp index 810ea6928..9dade0190 100644 --- a/code/nel/src/net/transport_class.cpp +++ b/code/nel/src/net/transport_class.cpp @@ -33,6 +33,9 @@ #include "nel/net/transport_class.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif // // Namespace diff --git a/code/nel/src/pacs/surface_quad.cpp b/code/nel/src/pacs/surface_quad.cpp index dade8462c..308dc0054 100644 --- a/code/nel/src/pacs/surface_quad.cpp +++ b/code/nel/src/pacs/surface_quad.cpp @@ -19,6 +19,10 @@ #include "nel/misc/file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index 5a21650e0..854a2c1dc 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -56,6 +56,10 @@ #include "nel/sound/containers.h" #include "nel/sound/audio_decoder.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/sound_bank.cpp b/code/nel/src/sound/sound_bank.cpp index ee00e1742..29621d337 100644 --- a/code/nel/src/sound/sound_bank.cpp +++ b/code/nel/src/sound/sound_bank.cpp @@ -33,6 +33,10 @@ #include "nel/georges/load_form.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; using namespace NLGEORGES; diff --git a/code/nel/src/sound/stdsound.h b/code/nel/src/sound/stdsound.h index 071e2c70c..474e64441 100644 --- a/code/nel/src/sound/stdsound.h +++ b/code/nel/src/sound/stdsound.h @@ -14,9 +14,15 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "nel/misc/types_nl.h" -#include "nel/misc/common.h" -#include "nel/misc/debug.h" +#ifndef SOUND_STDPCH_H +#define SOUND_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 @@ -40,6 +46,11 @@ #include +#include "nel/misc/types_nl.h" +#include "nel/misc/common.h" +#include "nel/misc/debug.h" #include "nel/misc/vector.h" #include "nel/misc/path.h" #include "nel/misc/file.h" + +#endif diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index bafb62103..577477ea2 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -45,6 +45,12 @@ #include "login_progress_post_thread.h" #include "interface_v3/action_handler_base.h" #include "item_group_manager.h" + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + + using namespace NLMISC; using namespace NLNET; using namespace NL3D; diff --git a/code/ryzom/client/src/ig_callback.cpp b/code/ryzom/client/src/ig_callback.cpp index 49b790d77..bf7b41625 100644 --- a/code/ryzom/client/src/ig_callback.cpp +++ b/code/ryzom/client/src/ig_callback.cpp @@ -45,6 +45,9 @@ #include "client_sheets/plant_sheet.h" #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif #define RZ_PRIM_ZEXT_BLOCK_AVOIDANCE 2.0f diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 244ef3384..6fc794d52 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -114,6 +114,10 @@ extern HWND SlashScreen; #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index d872f4553..11f0b1b88 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -35,6 +35,10 @@ #include "skill_manager.h" #include "game_share/bot_chat_types.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index 897cba9c1..a3a4751e7 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -37,6 +37,9 @@ // #include "../r2/editor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // Using // diff --git a/code/ryzom/client/src/movie_shooter.cpp b/code/ryzom/client/src/movie_shooter.cpp index 0bf6015bf..1358a20c4 100644 --- a/code/ryzom/client/src/movie_shooter.cpp +++ b/code/ryzom/client/src/movie_shooter.cpp @@ -31,6 +31,9 @@ #include "nel/misc/debug.h" #include "nel/misc/system_info.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 42285a167..d2789d2b9 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -89,6 +89,9 @@ // Std. #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif #define OLD_STRING_SYSTEM #define BAR_STEP_TP 2 diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index 2638f4162..730cb3477 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -98,6 +98,11 @@ using namespace CLFECOMMON; #include #include #include + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // Stat: array of vectors of cycles when a pos is received, indexed by TCLEntityId struct TRDateState { @@ -215,6 +220,12 @@ NLMISC_COMMAND( displayReceiveLog, "Flush the receive log into ReceiveLog.log", return true; } +#else + +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #endif // MEASURE_RECEIVE_DATES extern NL3D::UDriver *Driver; diff --git a/code/ryzom/client/src/pacs_client.cpp b/code/ryzom/client/src/pacs_client.cpp index 8e622d410..c021f7c1c 100644 --- a/code/ryzom/client/src/pacs_client.cpp +++ b/code/ryzom/client/src/pacs_client.cpp @@ -27,6 +27,10 @@ #include "ig_callback.h" #include "ig_client.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/scalable_time.cpp b/code/ryzom/client/src/scalable_time.cpp index dac59e198..9beb70795 100644 --- a/code/ryzom/client/src/scalable_time.cpp +++ b/code/ryzom/client/src/scalable_time.cpp @@ -21,6 +21,10 @@ #include "time_client.h" #include "nel/misc/time_nl.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // ************************************************************************************************* CScalableTime::CScalableTime() { diff --git a/code/ryzom/client/src/session_browser.cpp b/code/ryzom/client/src/session_browser.cpp index 46ef37a0a..e2fa97c6d 100644 --- a/code/ryzom/client/src/session_browser.cpp +++ b/code/ryzom/client/src/session_browser.cpp @@ -20,6 +20,10 @@ #include "game_share/r2_share_itf.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; using namespace NLNET; diff --git a/code/ryzom/client/src/session_browser_impl.cpp b/code/ryzom/client/src/session_browser_impl.cpp index 9e82a6d15..9762c4a90 100644 --- a/code/ryzom/client/src/session_browser_impl.cpp +++ b/code/ryzom/client/src/session_browser_impl.cpp @@ -34,6 +34,10 @@ // #include "game_share/shard_names.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; using namespace RSMGR; diff --git a/code/ryzom/client/src/sheet_manager.cpp b/code/ryzom/client/src/sheet_manager.cpp index 38a185d15..1c7f1f5ca 100644 --- a/code/ryzom/client/src/sheet_manager.cpp +++ b/code/ryzom/client/src/sheet_manager.cpp @@ -40,6 +40,9 @@ // Game Share #include "game_share/visual_slot_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/sky.cpp b/code/ryzom/client/src/sky.cpp index 9b3474ada..eb7f70d7c 100644 --- a/code/ryzom/client/src/sky.cpp +++ b/code/ryzom/client/src/sky.cpp @@ -19,6 +19,10 @@ #include "sky.h" #include "client_sheets/sky_sheet.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NL3D; using namespace NLMISC; diff --git a/code/ryzom/client/src/sky_material_setup.cpp b/code/ryzom/client/src/sky_material_setup.cpp index 8ee2d2a27..10074ba6b 100644 --- a/code/ryzom/client/src/sky_material_setup.cpp +++ b/code/ryzom/client/src/sky_material_setup.cpp @@ -22,6 +22,10 @@ #include "nel/3d/u_instance_material.h" #include "sky_material_setup.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NL3D; H_AUTO_DECL(RZ_SkyMaterialSetup) diff --git a/code/ryzom/client/src/sky_object.cpp b/code/ryzom/client/src/sky_object.cpp index ad6b7615f..94185ef93 100644 --- a/code/ryzom/client/src/sky_object.cpp +++ b/code/ryzom/client/src/sky_object.cpp @@ -26,6 +26,10 @@ #include "sky_object.h" #include "sky.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/sky_render.cpp b/code/ryzom/client/src/sky_render.cpp index fc3f3b09f..e917d3680 100644 --- a/code/ryzom/client/src/sky_render.cpp +++ b/code/ryzom/client/src/sky_render.cpp @@ -32,6 +32,9 @@ #include "light_cycle_manager.h" #include "global.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif H_AUTO_DECL(RZ_SkyRender) diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index 5c1f49b1c..8a91c81ff 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -53,6 +53,10 @@ # include "view.h" #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern CLightCycleManager LightCycleManager; extern NL3D::UDriver *Driver; extern NL3D::UCamera MainCam; diff --git a/code/ryzom/client/src/stage.cpp b/code/ryzom/client/src/stage.cpp index 9211f3d6c..05db01768 100644 --- a/code/ryzom/client/src/stage.cpp +++ b/code/ryzom/client/src/stage.cpp @@ -24,6 +24,9 @@ #include "stage.h" #include "game_share/entity_types.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/streamable_entity.cpp b/code/ryzom/client/src/streamable_entity.cpp index f1c19efd9..1bba624dc 100644 --- a/code/ryzom/client/src/streamable_entity.cpp +++ b/code/ryzom/client/src/streamable_entity.cpp @@ -19,6 +19,9 @@ #include "stdpch.h" #include "streamable_entity.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif H_AUTO_DECL(RZ_StreamableEntity) diff --git a/code/ryzom/client/src/streamable_entity_composite.cpp b/code/ryzom/client/src/streamable_entity_composite.cpp index ae9f1998e..01e4aff17 100644 --- a/code/ryzom/client/src/streamable_entity_composite.cpp +++ b/code/ryzom/client/src/streamable_entity_composite.cpp @@ -21,6 +21,10 @@ #include "streamable_entity_composite.h" #include "nel/misc/progress_callback.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + H_AUTO_DECL(RZ_StremableEntityComposite) //=============================================================================== diff --git a/code/ryzom/client/src/streamable_ig.cpp b/code/ryzom/client/src/streamable_ig.cpp index e93b62c4c..eaaea24f5 100644 --- a/code/ryzom/client/src/streamable_ig.cpp +++ b/code/ryzom/client/src/streamable_ig.cpp @@ -28,6 +28,10 @@ #include "streamable_ig.h" #include "continent_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + extern CContinentManager ContinentMngr; H_AUTO_DECL(RZ_StremableIG) diff --git a/code/ryzom/client/src/string_manager_client.cpp b/code/ryzom/client/src/string_manager_client.cpp index b4edce7e1..cf83a1e0a 100644 --- a/code/ryzom/client/src/string_manager_client.cpp +++ b/code/ryzom/client/src/string_manager_client.cpp @@ -27,6 +27,10 @@ #include "misc.h" #include "entity_cl.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/teleport.cpp b/code/ryzom/client/src/teleport.cpp index c85c938fa..60d96c794 100644 --- a/code/ryzom/client/src/teleport.cpp +++ b/code/ryzom/client/src/teleport.cpp @@ -29,6 +29,9 @@ #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/text_manager.cpp b/code/ryzom/client/src/text_manager.cpp index 9d152dcc9..bb78bffff 100644 --- a/code/ryzom/client/src/text_manager.cpp +++ b/code/ryzom/client/src/text_manager.cpp @@ -25,6 +25,10 @@ #include "text_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/time_client.cpp b/code/ryzom/client/src/time_client.cpp index 495e0af66..c67f70d05 100644 --- a/code/ryzom/client/src/time_client.cpp +++ b/code/ryzom/client/src/time_client.cpp @@ -34,6 +34,9 @@ #include "weather.h" #include "game_share/light_cycle.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif /////////// // USING // diff --git a/code/ryzom/client/src/timed_fx_manager.cpp b/code/ryzom/client/src/timed_fx_manager.cpp index d37ab782f..8741e5197 100644 --- a/code/ryzom/client/src/timed_fx_manager.cpp +++ b/code/ryzom/client/src/timed_fx_manager.cpp @@ -32,8 +32,8 @@ #include "nel/misc/check_fpu.h" -#if defined(NL_DEBUG) && defined(NL_OS_WINDOWS) - #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW #endif using namespace std::rel_ops; diff --git a/code/ryzom/client/src/user_agent.cpp b/code/ryzom/client/src/user_agent.cpp index 7ba2b4e38..25e84bcb7 100644 --- a/code/ryzom/client/src/user_agent.cpp +++ b/code/ryzom/client/src/user_agent.cpp @@ -47,6 +47,10 @@ #define RYZOM_CLIENT_ICON "ryzom_client" #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + std::string getUserAgent() { return getUserAgentName() + "/" + getUserAgentVersion(); diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index cad200aeb..80fccf07c 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -80,6 +80,10 @@ // r2 #include "r2/editor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + /////////// // USING // /////////// diff --git a/code/ryzom/client/src/view.cpp b/code/ryzom/client/src/view.cpp index 4bc52af08..8d097d142 100644 --- a/code/ryzom/client/src/view.cpp +++ b/code/ryzom/client/src/view.cpp @@ -37,6 +37,10 @@ #include "motion/user_controls.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using NL3D::UVisualCollisionManager; extern UVisualCollisionManager *CollisionManager; diff --git a/code/ryzom/client/src/village.cpp b/code/ryzom/client/src/village.cpp index 5a94d93d3..41d698782 100644 --- a/code/ryzom/client/src/village.cpp +++ b/code/ryzom/client/src/village.cpp @@ -33,6 +33,10 @@ #include "pacs_client.h" #include "client_cfg.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/ryzom/client/src/water_env_map_rdr.cpp b/code/ryzom/client/src/water_env_map_rdr.cpp index a5294a74d..a1d87ae23 100644 --- a/code/ryzom/client/src/water_env_map_rdr.cpp +++ b/code/ryzom/client/src/water_env_map_rdr.cpp @@ -27,6 +27,10 @@ #include "nel/misc/matrix.h" #include "nel/misc/vectord.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NL3D; using namespace NLMISC; diff --git a/code/ryzom/client/src/water_map.cpp b/code/ryzom/client/src/water_map.cpp index 76a4119f7..727b48311 100644 --- a/code/ryzom/client/src/water_map.cpp +++ b/code/ryzom/client/src/water_map.cpp @@ -31,6 +31,9 @@ #include "nel/misc/path.h" #include "nel/misc/file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif extern NL3D::UScene *Scene; extern NL3D::UDriver *Driver; diff --git a/code/ryzom/client/src/weather.cpp b/code/ryzom/client/src/weather.cpp index 91fad6f7c..5891ecb9f 100644 --- a/code/ryzom/client/src/weather.cpp +++ b/code/ryzom/client/src/weather.cpp @@ -36,6 +36,9 @@ // #include "r2/editor.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif H_AUTO_DECL(RZ_Weather) diff --git a/code/ryzom/client/src/weather_manager_client.cpp b/code/ryzom/client/src/weather_manager_client.cpp index 8c0018fdf..81bf0236f 100644 --- a/code/ryzom/client/src/weather_manager_client.cpp +++ b/code/ryzom/client/src/weather_manager_client.cpp @@ -31,6 +31,10 @@ #include "sound_manager.h" #include "client_cfg.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + H_AUTO_DECL(RZ_WeatherManagerClient) using namespace NLMISC; diff --git a/code/ryzom/client/src/weather_setup_client.cpp b/code/ryzom/client/src/weather_setup_client.cpp index 54df5d05f..519b29d3a 100644 --- a/code/ryzom/client/src/weather_setup_client.cpp +++ b/code/ryzom/client/src/weather_setup_client.cpp @@ -25,6 +25,9 @@ using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif H_AUTO_DECL(RZ_WeatherSetupClient) diff --git a/code/ryzom/client/src/world_database_manager.cpp b/code/ryzom/client/src/world_database_manager.cpp index a735ab982..72add4415 100644 --- a/code/ryzom/client/src/world_database_manager.cpp +++ b/code/ryzom/client/src/world_database_manager.cpp @@ -25,6 +25,9 @@ #include "world_database_manager.h" #include "continent_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif ///////////// // GLOBALS // diff --git a/code/ryzom/client/src/zone_util.cpp b/code/ryzom/client/src/zone_util.cpp index c5616d0e0..33b7fdf68 100644 --- a/code/ryzom/client/src/zone_util.cpp +++ b/code/ryzom/client/src/zone_util.cpp @@ -23,6 +23,9 @@ using namespace std; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif bool getPosFromZoneName(const std::string &name,NLMISC::CVector2f &dest) { diff --git a/code/ryzom/common/src/game_share/dms.cpp b/code/ryzom/common/src/game_share/dms.cpp index 8f8af5b51..3619c294c 100644 --- a/code/ryzom/common/src/game_share/dms.cpp +++ b/code/ryzom/common/src/game_share/dms.cpp @@ -45,6 +45,9 @@ #include "server_edition_module.h" #include "server_animation_module.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace R2; using namespace NLNET; diff --git a/code/ryzom/common/src/game_share/dyn_chat.cpp b/code/ryzom/common/src/game_share/dyn_chat.cpp index aae0015d7..eed4f33b0 100644 --- a/code/ryzom/common/src/game_share/dyn_chat.cpp +++ b/code/ryzom/common/src/game_share/dyn_chat.cpp @@ -17,6 +17,10 @@ #include "stdpch.h" #include "dyn_chat.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; NL_INSTANCE_COUNTER_IMPL(CDynChatSession); diff --git a/code/ryzom/common/src/game_share/fame.cpp b/code/ryzom/common/src/game_share/fame.cpp index 919ee3c93..a0e633199 100644 --- a/code/ryzom/common/src/game_share/fame.cpp +++ b/code/ryzom/common/src/game_share/fame.cpp @@ -24,6 +24,10 @@ //#include "../entities_game_service/egs_variables.h" //#include "pvp_clan.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; using namespace STRING_MANAGER; diff --git a/code/ryzom/common/src/game_share/generic_xml_msg_mngr.cpp b/code/ryzom/common/src/game_share/generic_xml_msg_mngr.cpp index b3c002015..fd30af70d 100644 --- a/code/ryzom/common/src/game_share/generic_xml_msg_mngr.cpp +++ b/code/ryzom/common/src/game_share/generic_xml_msg_mngr.cpp @@ -22,6 +22,10 @@ #include "nel/misc/file.h" #include "nel/misc/xml_auto_ptr.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/ryzom/common/src/game_share/mirror.cpp b/code/ryzom/common/src/game_share/mirror.cpp index 0e634afaf..23e975831 100644 --- a/code/ryzom/common/src/game_share/mirror.cpp +++ b/code/ryzom/common/src/game_share/mirror.cpp @@ -21,6 +21,10 @@ #include "synchronised_message.h" #include "tick_proxy_time_measure.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace NLNET; using namespace std; diff --git a/code/ryzom/common/src/game_share/mirror_prop_value.cpp b/code/ryzom/common/src/game_share/mirror_prop_value.cpp index 5383a2443..5bb63e2d0 100644 --- a/code/ryzom/common/src/game_share/mirror_prop_value.cpp +++ b/code/ryzom/common/src/game_share/mirror_prop_value.cpp @@ -19,6 +19,9 @@ #include "stdpch.h" #include "mirror_prop_value.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif sint32 NbAllocdListCells = 0; sint32 MaxNbAllocdListCells = 0; diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index f914085e4..326e6dd1f 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -25,6 +25,10 @@ #include +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + namespace R2 { diff --git a/code/ryzom/common/src/game_share/persistent_data_tree.cpp b/code/ryzom/common/src/game_share/persistent_data_tree.cpp index d10f01013..a8a15f06a 100644 --- a/code/ryzom/common/src/game_share/persistent_data_tree.cpp +++ b/code/ryzom/common/src/game_share/persistent_data_tree.cpp @@ -77,6 +77,9 @@ #include "stdpch.h" #include "persistent_data_tree.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif //----------------------------------------------------------------------------- // Namespaces diff --git a/code/ryzom/common/src/game_share/ring_access.cpp b/code/ryzom/common/src/game_share/ring_access.cpp index 9e0ba8ce4..479b69291 100644 --- a/code/ryzom/common/src/game_share/ring_access.cpp +++ b/code/ryzom/common/src/game_share/ring_access.cpp @@ -35,6 +35,9 @@ #include "nel/misc/xml_auto_ptr.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace std; using namespace R2; diff --git a/code/ryzom/common/src/game_share/scenario.cpp b/code/ryzom/common/src/game_share/scenario.cpp index e2437eac2..3782c45cf 100644 --- a/code/ryzom/common/src/game_share/scenario.cpp +++ b/code/ryzom/common/src/game_share/scenario.cpp @@ -31,6 +31,10 @@ #include "nel/misc/file.h" #include "nel/misc/algo.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace R2; //---------------------------------------------------------------- namespace R2 diff --git a/code/ryzom/common/src/game_share/server_edition_module.cpp b/code/ryzom/common/src/game_share/server_edition_module.cpp index b3e4c6b53..79cf9a6f2 100644 --- a/code/ryzom/common/src/game_share/server_edition_module.cpp +++ b/code/ryzom/common/src/game_share/server_edition_module.cpp @@ -60,6 +60,9 @@ //#include "server_admin_module.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif using namespace std; using namespace NLMISC; diff --git a/code/ryzom/common/src/game_share/simlag.cpp b/code/ryzom/common/src/game_share/simlag.cpp index 0468caa2b..86f61b60b 100644 --- a/code/ryzom/common/src/game_share/simlag.cpp +++ b/code/ryzom/common/src/game_share/simlag.cpp @@ -22,6 +22,10 @@ // Includes // +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + // // Using // diff --git a/code/ryzom/common/src/game_share/stdpch.h b/code/ryzom/common/src/game_share/stdpch.h index cdec993d9..46c71bcfe 100644 --- a/code/ryzom/common/src/game_share/stdpch.h +++ b/code/ryzom/common/src/game_share/stdpch.h @@ -14,7 +14,15 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "nel/misc/types_nl.h" +#ifndef GAMESHARE_STDPCH_H +#define GAMESHARE_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 @@ -38,6 +46,7 @@ #include #include +#include "nel/misc/types_nl.h" #include #include @@ -75,3 +84,5 @@ # include # include #endif + +#endif diff --git a/code/ryzom/common/src/game_share/visual_slot_manager.cpp b/code/ryzom/common/src/game_share/visual_slot_manager.cpp index bc2410eea..4c4470a5b 100644 --- a/code/ryzom/common/src/game_share/visual_slot_manager.cpp +++ b/code/ryzom/common/src/game_share/visual_slot_manager.cpp @@ -30,6 +30,10 @@ #include "visual_slot_manager.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + //////////////////// // STATIC MEMBERS // ////////////////////