Added a new branch that implements support for outputting all memory leaks to
the debug output for the Debug and FastDebug project configurations. This requires replacing all instances of new with a macro, smnew, that defines a special form of new which outputs file and line number information along with the memory leak details. This makes finding memory leaks much easier since you can just double-click the leak in the output window and it will take you to the line that caused it.
This commit is contained in:
@@ -59,7 +59,7 @@ public:
|
||||
IDebugLine()
|
||||
{
|
||||
if( g_pvpSubscribers == NULL )
|
||||
g_pvpSubscribers = new vector<IDebugLine*>;
|
||||
g_pvpSubscribers = smnew vector<IDebugLine*>;
|
||||
g_pvpSubscribers->push_back( this );
|
||||
}
|
||||
virtual ~IDebugLine() { }
|
||||
@@ -260,7 +260,7 @@ void ScreenDebugOverlay::Init()
|
||||
|
||||
RString sButton = INPUTMAN->GetDeviceSpecificInputString( di );
|
||||
|
||||
BitmapText *p = new BitmapText;
|
||||
BitmapText *p = smnew BitmapText;
|
||||
p->SetName( "PageText" );
|
||||
p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "page") );
|
||||
LOAD_ALL_COMMANDS_AND_ON_COMMAND( p );
|
||||
@@ -274,7 +274,7 @@ void ScreenDebugOverlay::Init()
|
||||
FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p )
|
||||
{
|
||||
{
|
||||
BitmapText *bt = new BitmapText;
|
||||
BitmapText *bt = smnew BitmapText;
|
||||
bt->SetName( "ButtonText" );
|
||||
bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
|
||||
bt->SetHorizAlign( align_right );
|
||||
@@ -284,7 +284,7 @@ void ScreenDebugOverlay::Init()
|
||||
this->AddChild( bt );
|
||||
}
|
||||
{
|
||||
BitmapText *bt = new BitmapText;
|
||||
BitmapText *bt = smnew BitmapText;
|
||||
bt->SetName( "FunctionText" );
|
||||
bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
|
||||
bt->SetHorizAlign( align_left );
|
||||
|
||||
Reference in New Issue
Block a user