[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : gerry
Repository : xara
Revision   : 1464
Date       : Tue Jul 18 13:32:34 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/app.cpp
   M /Trunk/XaraLX/Kernel/bitmap.cpp
   M /Trunk/XaraLX/Kernel/fillval.cpp
   M /Trunk/XaraLX/Kernel/fontcomp.cpp
   M /Trunk/XaraLX/Kernel/hotkeys.cpp
   M /Trunk/XaraLX/Kernel/main.cpp
   M /Trunk/XaraLX/Kernel/menuitem.cpp
   M /Trunk/XaraLX/Kernel/menuops.cpp
   M /Trunk/XaraLX/Kernel/modlist.cpp
   M /Trunk/XaraLX/Kernel/module.cpp
   M /Trunk/XaraLX/Kernel/prefs.cpp
   M /Trunk/XaraLX/Kernel/printing.cpp
   M /Trunk/XaraLX/Kernel/rechtext.cpp
   M /Trunk/XaraLX/Kernel/sginit.cpp
   M /Trunk/XaraLX/Kernel/tool.cpp
   M /Trunk/XaraLX/tools/eliptool.cpp
   M /Trunk/XaraLX/tools/pushtool.cpp
   M /Trunk/XaraLX/tools/rectangl.cpp
   M /Trunk/XaraLX/tools/viewmod.cpp
   M /Trunk/XaraLX/tools/zoomtool.cpp
   M /Trunk/XaraLX/wxOil/camdoc.cpp
   M /Trunk/XaraLX/wxOil/camframe.cpp
   M /Trunk/XaraLX/wxOil/camprofile.cpp
   M /Trunk/XaraLX/wxOil/camresource.cpp
   M /Trunk/XaraLX/wxOil/camview.cpp
   M /Trunk/XaraLX/wxOil/ccobject.cpp
   M /Trunk/XaraLX/wxOil/ccolbar.cpp
   M /Trunk/XaraLX/wxOil/ctrllist.cpp
   M /Trunk/XaraLX/wxOil/dibutil.cpp
   M /Trunk/XaraLX/wxOil/dlgmgr.cpp
   M /Trunk/XaraLX/wxOil/exceptio.cpp
   M /Trunk/XaraLX/wxOil/memory.cpp
   M /Trunk/XaraLX/wxOil/oilbitmap.cpp
   M /Trunk/XaraLX/wxOil/oilfltrs.cpp
   M /Trunk/XaraLX/wxOil/oilmenus.cpp
   M /Trunk/XaraLX/wxOil/oilmods.cpp
   M /Trunk/XaraLX/wxOil/oilruler.cpp
   M /Trunk/XaraLX/wxOil/rendwnd.cpp

Added lots of #define new CAM_DEBUG_NEW and fixed all currently reported memory leaks


Diff:
Index: Trunk/XaraLX/tools/pushtool.cpp
===================================================================
--- Trunk/XaraLX/tools/pushtool.cpp	(revision 1463)
+++ Trunk/XaraLX/tools/pushtool.cpp	(revision 1464)
@@ -140,7 +140,10 @@
 
 
 CC_IMPLEMENT_MEMDUMP(PushTool, Tool_v1)
+CC_IMPLEMENT_DYNCREATE( OpPush, Operation )
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
 /********************************************************************************************
 
@@ -559,7 +562,6 @@
 //  The Push Operation
 
 
-CC_IMPLEMENT_DYNCREATE( OpPush, Operation )
 
 /********************************************************************************************
 
Index: Trunk/XaraLX/tools/viewmod.cpp
===================================================================
--- Trunk/XaraLX/tools/viewmod.cpp	(revision 1463)
+++ Trunk/XaraLX/tools/viewmod.cpp	(revision 1464)
@@ -135,8 +135,9 @@
 
 DECLARE_SOURCE("$Revision$");
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
-
 // this macro makes it easier to move tools from the .exe to the .dll
 // in AFXDLL builds, the macro returns NULL, otherwise it does a 'new classtype'
 
Index: Trunk/XaraLX/tools/rectangl.cpp
===================================================================
--- Trunk/XaraLX/tools/rectangl.cpp	(revision 1463)
+++ Trunk/XaraLX/tools/rectangl.cpp	(revision 1464)
@@ -124,6 +124,9 @@
 
 CC_IMPLEMENT_MEMDUMP( RectangleTool, QuickShapeBase )
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	RectangleTool::RectangleTool()
Index: Trunk/XaraLX/tools/zoomtool.cpp
===================================================================
--- Trunk/XaraLX/tools/zoomtool.cpp	(revision 1463)
+++ Trunk/XaraLX/tools/zoomtool.cpp	(revision 1464)
@@ -145,6 +145,8 @@
 
 CC_IMPLEMENT_MEMDUMP(ZoomTool, Tool_v1)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
 // *******************************************************
 // MIN and MAX Macros - These should not be here, I'm sure
Index: Trunk/XaraLX/tools/eliptool.cpp
===================================================================
--- Trunk/XaraLX/tools/eliptool.cpp	(revision 1463)
+++ Trunk/XaraLX/tools/eliptool.cpp	(revision 1464)
@@ -123,6 +123,9 @@
 
 CC_IMPLEMENT_MEMDUMP( EllipseTool, QuickShapeBase )
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	EllipseTool::EllipseTool()
Index: Trunk/XaraLX/Kernel/modlist.cpp
===================================================================
--- Trunk/XaraLX/Kernel/modlist.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/modlist.cpp	(revision 1464)
@@ -108,6 +108,9 @@
 CC_IMPLEMENT_MEMDUMP(ModuleListItem, ListItem)
 CC_IMPLEMENT_MEMDUMP(ModuleList, List)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	ModuleListItem(Module *pNewModule, OILModule *pNewOILModule)
@@ -155,10 +158,10 @@
 	
 	if( NULL != m_pOILModule )
 	{
-		PORTNOTETRACE("other","ModuleListItem::~ModuleListItem - m_pOILModule NOT deleted");
-#ifndef EXCLUDE_FROM_XARALX
+//		PORTNOTETRACE("other","ModuleListItem::~ModuleListItem - m_pOILModule NOT deleted");
+//#ifndef EXCLUDE_FROM_XARALX
 		delete m_pOILModule;
-#endif
+//#endif
 		m_pOILModule = NULL;
 	}
 }
Index: Trunk/XaraLX/Kernel/app.cpp
===================================================================
--- Trunk/XaraLX/Kernel/app.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/app.cpp	(revision 1464)
@@ -163,6 +163,9 @@
 
 CC_IMPLEMENT_MEMDUMP(Application, CCObject)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 Application Camelot;
 
 /***********************************************************************************************
@@ -664,7 +667,8 @@
 		TheNoiseManager=NULL;
 	}
 
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
+#if !defined(EXCLUDE_FROM_XARALX)
 PORTNOTE("colourmanager","Removed XaraCMS usage")
 	if (CMSManager!=NULL)
 	{
@@ -684,13 +688,14 @@
 	}
 #endif // VECTOR_STROKING
 
+#endif	// EXCLUDE_FROM_XARALX
 	// Get rid of the blob manager
 	if (BlobMgr!=NULL)
 	{
 		delete BlobMgr;
 		BlobMgr = NULL;
 	}
-#endif // EXCLUDE_FROM_RALPH, EXCLUDE_FROM_XARALX
+#endif // EXCLUDE_FROM_RALPH
 
 PORTNOTE("other","Removed un-=impl. stuff")
 #ifndef EXCLUDE_FROM_XARALX
Index: Trunk/XaraLX/Kernel/rechtext.cpp
===================================================================
--- Trunk/XaraLX/Kernel/rechtext.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/rechtext.cpp	(revision 1464)
@@ -132,6 +132,9 @@
 CC_IMPLEMENT_DYNAMIC(TextAttrRecordHandler, CamelotRecordHandler);
 CC_IMPLEMENT_DYNAMIC(FontDefRecordHandler, CamelotRecordHandler);
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	BOOL TextObjRecordHandler::BeginImport()
Index: Trunk/XaraLX/Kernel/fontcomp.cpp
===================================================================
--- Trunk/XaraLX/Kernel/fontcomp.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/fontcomp.cpp	(revision 1464)
@@ -247,6 +247,9 @@
 CC_IMPLEMENT_DYNAMIC(FontComponentList, List)
 CC_IMPLEMENT_DYNAMIC(FontComponent, DocComponent)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	BOOL FontComponentClass::Init()
Index: Trunk/XaraLX/Kernel/hotkeys.cpp
===================================================================
--- Trunk/XaraLX/Kernel/hotkeys.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/hotkeys.cpp	(revision 1464)
@@ -119,6 +119,9 @@
 
 CC_IMPLEMENT_MEMDUMP(HotKey,ListItem)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 static List HotKeyList;
 
 enum HK_TokenIndex
@@ -307,7 +310,12 @@
 			}
 		}
 		else
+		{
 			TRACE( _T("HotKey: Unable to find op desc \"%s\"
"),pOpToken);
+			// These will only get deleted if we return false so delete them here
+			delete pKeyPress;
+			delete pTextDesc;
+		}
 	}
 
 	return ok;
@@ -685,10 +693,10 @@
 
 BOOL HotKey::ReadHotKey(CCLexFile& file)
 {
-	KeyPress* pKeyPress;
+	KeyPress* pKeyPress = NULL;
 	String_256 OpToken;
-	String_32* pTextDesc;
-	BOOL CheckUnicode;;
+	String_32* pTextDesc = NULL;
+	BOOL CheckUnicode;
 
 	BOOL ok = HotKey::ReadKeyDef(file,&pKeyPress,&OpToken,&pTextDesc,&CheckUnicode);
 
@@ -697,6 +705,11 @@
 		ok = HotKey::AddHotKey(pKeyPress,OpToken,pTextDesc,CheckUnicode);
 		if (!ok) TRACE( _T("HotKey: Unable to add hot key to the system
"));
 	}
+	else
+	{
+		delete pKeyPress;
+		delete pTextDesc;
+	}
 
 	return (ok);
 }
@@ -717,10 +730,10 @@
 
 BOOL HotKey::ReadToolSwitch(CCLexFile& file)
 {
-	KeyPress* pKeyPress;
+	KeyPress* pKeyPress = NULL;
 	String_256 OpToken;
-	String_32* pTextDesc;	// This is not used with tool switches
-	BOOL CheckUnicode;		// This is not used with tool switches
+	String_32* pTextDesc = NULL;	// This is not used with tool switches
+	BOOL CheckUnicode;				// This is not used with tool switches
 
 	BOOL ok = HotKey::ReadKeyDef(file,&pKeyPress,&OpToken,&pTextDesc,&CheckUnicode);
 
@@ -747,7 +760,11 @@
 			if (ok)
 			{
 				ok = pToolListItem->m_pTool->RegisterToolSwitch(pKeyPress,TRUE);
-				if (!ok) TRACE( _T("HotKey: Unable to register the tool switch
"));
+				if (!ok)
+				{
+					TRACE( _T("HotKey: Unable to register the tool switch
"));
+					delete pKeyPress;
+				}
 			}
 			else
 				TRACE( _T("HotKey: Dodgy ToolListItem for the tool ID %ld
"),ToolID);
@@ -755,6 +772,10 @@
 		else
 			TRACE( _T("HotKey: Unable to find op '%s'
"),(TCHAR*)OpToken);
 	}
+	else
+	{
+		delete pKeyPress;
+	}
 
 	return (ok);
 }
@@ -935,6 +956,11 @@
 			delete *ppKeyPress;
 			*ppKeyPress = NULL;
 		}
+		if (pTextDesc != NULL)
+		{
+			delete pTextDesc;
+			pTextDesc = NULL;
+		}
 	}
 
 	return (ok);
Index: Trunk/XaraLX/Kernel/menuitem.cpp
===================================================================
--- Trunk/XaraLX/Kernel/menuitem.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/menuitem.cpp	(revision 1464)
@@ -121,6 +121,9 @@
 CC_IMPLEMENT_MEMDUMP(MenuItem, CmdControl)
 CC_IMPLEMENT_DYNAMIC(OpMenuParam, OpParam)
 
+// This will get Camelot to display the filename and linenumber of any memory allocations
+// that are not released at program exit
+#define new CAM_DEBUG_NEW
 
 /********************************************************************************************
 
@@ -204,7 +207,10 @@
 MenuItem::~MenuItem()
 {
 	if (SubMenuItems != NULL)
+	{
+		SubMenuItems->DeleteAll();
 		delete SubMenuItems;
+	}
 
 	if (pMenuParam)
 	{
Index: Trunk/XaraLX/Kernel/module.cpp
===================================================================
--- Trunk/XaraLX/Kernel/module.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/module.cpp	(revision 1464)
@@ -123,6 +123,9 @@
 CC_IMPLEMENT_MEMDUMP(Module_v1, CCObject)
 CC_IMPLEMENT_MEMDUMP(Module, Module_v1)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	void Module::InitModules()
Index: Trunk/XaraLX/Kernel/fillval.cpp
===================================================================
--- Trunk/XaraLX/Kernel/fillval.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/fillval.cpp	(revision 1464)
@@ -205,7 +205,7 @@
 CC_IMPLEMENT_DYNCREATE(MouldAttribute,	AttributeValue)
 
 // Declare smart memory handling in Debug builds
-//#define	new	CAM_DEBUG_NEW
+#define	new	CAM_DEBUG_NEW
 
 // funky functions for use with our profile gadgets ....
 
Index: Trunk/XaraLX/Kernel/prefs.cpp
===================================================================
--- Trunk/XaraLX/Kernel/prefs.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/prefs.cpp	(revision 1464)
@@ -117,6 +117,9 @@
 // Dynamic classing implementation
 CC_IMPLEMENT_MEMDUMP(Preferences,       List)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 #if !defined(EXCLUDE_FROM_RALPH)
 
 /********************************************************************************************
Index: Trunk/XaraLX/Kernel/menuops.cpp
===================================================================
--- Trunk/XaraLX/Kernel/menuops.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/menuops.cpp	(revision 1464)
@@ -280,7 +280,11 @@
 
 CC_IMPLEMENT_DYNCREATE  (OpToolSelect,  Operation)
 
+// This will get Camelot to display the filename and linenumber of any memory allocations
+// that are not released at program exit
+#define new CAM_DEBUG_NEW
 
+
 //********************************************************************************************
 //                                                                      TOOL SELECTION OPERATION
 /********************************************************************************************
Index: Trunk/XaraLX/Kernel/printing.cpp
===================================================================
--- Trunk/XaraLX/Kernel/printing.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/printing.cpp	(revision 1464)
@@ -119,6 +119,9 @@
 
 CC_IMPLEMENT_DYNCREATE(OpPrint, Operation)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	OpPrint::OpPrint()
Index: Trunk/XaraLX/Kernel/sginit.cpp
===================================================================
--- Trunk/XaraLX/Kernel/sginit.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/sginit.cpp	(revision 1464)
@@ -113,7 +113,7 @@
 #include "ngdialog.h"	// For OpDisplayNameGallery & OpNGPropertyIndexDesc
 //#include "sgscan.h"		// For Library::InitLibPrefs() - in camtypes.h [AUTOMATICALLY REMOVED]
 #include "layerprp.h"	// For LayerPropertiesDlg::Init()
-//#include "aprps.h"
+#include "aprps.h"
 //#include "frameops.h"	// OpGrabFrame::Init()
 
 // Taken out by vector stroking code Neville 2/10/97
@@ -233,12 +233,10 @@
 PORTNOTE("galleries", "disabled various galleries deinit")
 #ifndef STANDALONE
 #ifndef WEBSTER
-#ifndef EXCLUDE_FROM_XARALX
 	LayerPropertyTabsDlg::Deinit();	
-#endif
 #endif	// WEBSTER	
-#ifndef EXCLUDE_FROM_XARALX
 	GIFAnimationPropertyTabsDlg::Deinit();
+#ifndef EXCLUDE_FROM_XARALX
 	OpGrabFrame::DeInit();
 #endif
 #endif
Index: Trunk/XaraLX/Kernel/bitmap.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bitmap.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/bitmap.cpp	(revision 1464)
@@ -142,7 +142,9 @@
 CC_IMPLEMENT_DYNAMIC( KernelBmpListItem, ListItem )
 
 
-//#define	new	CAM_DEBUG_NEW
+// This will get Camelot to display the filename and linenumber of any memory allocations
+// that are not released at program exit
+#define new CAM_DEBUG_NEW
 
 
 // Static default bitmap pointer
Index: Trunk/XaraLX/Kernel/tool.cpp
===================================================================
--- Trunk/XaraLX/Kernel/tool.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/tool.cpp	(revision 1464)
@@ -1419,7 +1419,10 @@
 		{
 			// if this tool switch has already been assigned for this tool, return TRUE
 			if (*pToolSwitch->pKeyPress == *pKeyPress)
+			{
+				delete pKeyPress;
 				return TRUE;
+			}
 		}
 		else
 		{
Index: Trunk/XaraLX/Kernel/main.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main.cpp	(revision 1463)
+++ Trunk/XaraLX/Kernel/main.cpp	(revision 1464)
@@ -118,7 +118,7 @@
 #include "sginit.h"
 #include "sgliboil.h"
 //#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
-//#include "oilmenus.h"
+#include "oilmenus.h"
 #include "oilruler.h"
 #include "layer.h"
 //#include "atminst.h"
@@ -336,7 +336,8 @@
 	ATMInstall::AliasList.DeInit();
 	DeinitButtonBar();
 #endif
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
+// && !defined(EXCLUDE_FROM_XARALX)
 	DeinitMenuSystem();
 #endif
 	DimScale::Deinit();
@@ -345,7 +346,8 @@
 	GlobalBitmapList::DeInit();
 	GlobalFractalList::DeInit();
 	OILBitmap::Deinit();
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
+// && !defined(EXCLUDE_FROM_XARALX)
 	HotKey::Deinit(); 
 #endif
 #ifndef DISABLE_TEXT_RENDERING
Index: Trunk/XaraLX/wxOil/rendwnd.cpp
===================================================================
--- Trunk/XaraLX/wxOil/rendwnd.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/rendwnd.cpp	(revision 1464)
@@ -125,6 +125,9 @@
 
 IMPLEMENT_DYNAMIC_CLASS( CRenderWnd, wxWindow )
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 BEGIN_EVENT_TABLE( CRenderWnd, wxWindow )
 	EVT_PAINT(				CRenderWnd::OnPaint )			
 	EVT_ERASE_BACKGROUND(	CRenderWnd::OnErase )
Index: Trunk/XaraLX/wxOil/ccolbar.cpp
===================================================================
--- Trunk/XaraLX/wxOil/ccolbar.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/ccolbar.cpp	(revision 1464)
@@ -272,9 +272,10 @@
 CC_IMPLEMENT_DYNAMIC(EditButtonDragTarget, OilDragTarget)
 CC_IMPLEMENT_DYNAMIC(ColourLineDragTarget, OilDragTarget)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
 
-
 /********************************************************************************************
 
 >	inline Document *SetCurrentDoc(void)
Index: Trunk/XaraLX/wxOil/memory.cpp
===================================================================
--- Trunk/XaraLX/wxOil/memory.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/memory.cpp	(revision 1464)
@@ -124,9 +124,10 @@
 
 DECLARE_SOURCE("$Revision$");
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
 
-
 /********************************************************************************************
 
 
Index: Trunk/XaraLX/wxOil/camresource.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camresource.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/camresource.cpp	(revision 1464)
@@ -115,6 +115,8 @@
 
 CC_IMPLEMENT_DYNCREATE(CamResource, CCObject)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
 ResIDToString * CamResource::pHash = NULL;
 ResIDToString * CamResource::pObjectNameHash = NULL;
Index: Trunk/XaraLX/wxOil/oilbitmap.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilbitmap.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/oilbitmap.cpp	(revision 1464)
@@ -141,7 +141,7 @@
 CC_IMPLEMENT_DYNAMIC( CWxBitmap, OILBitmap )
 
 // Declare smart memory handling in Debug builds
-//#define	new	CAM_DEBUG_NEW
+#define new CAM_DEBUG_NEW
 
 
 // firstly the bits of the OILBitmap class that get implemented in the OIL layer
Index: Trunk/XaraLX/wxOil/exceptio.cpp
===================================================================
--- Trunk/XaraLX/wxOil/exceptio.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/exceptio.cpp	(revision 1464)
@@ -119,6 +119,8 @@
 
 CC_IMPLEMENT_DYNCREATE(OpException, Operation)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
 /*******************************************************************
 
Index: Trunk/XaraLX/wxOil/dibutil.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dibutil.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/dibutil.cpp	(revision 1464)
@@ -125,6 +125,9 @@
 #include "hardwaremanager.h"
 using namespace oilHardwareManager;
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 // if this is non-zero, then extra scanlines get allocated to help find walking-past bitmap
 // type bugs
 #define	DIB_DEBUG	0
Index: Trunk/XaraLX/wxOil/oilfltrs.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilfltrs.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/oilfltrs.cpp	(revision 1464)
@@ -157,6 +157,9 @@
 //CC_IMPLEMENT_MEMDUMP(AldusFormatFilter, MetaFileFilter )
 #endif
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 /********************************************************************************************
 
 >	OILFilter::OILFilter(Filter *pFilter)
Index: Trunk/XaraLX/wxOil/oilmenus.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilmenus.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/oilmenus.cpp	(revision 1464)
@@ -693,17 +693,17 @@
 		CamelotMDIMenu = NULL;
 	}
 
+PORTNOTE("other","Removed menu destruction - temporary!")
+#if 0
 	if (WinMDIMenu)
 	{
-PORTNOTE("other","Removed menu destruction - may not be needed, lifetime controlled by window!")
-#if 0
 		DestroyWinMenu(WinMDIMenu);			//Destroy The MDI Frame Menu
-#endif
+
 		WinMDIMenu->Detach();
 		delete WinMDIMenu;
 		WinMDIMenu = NULL;
 	}
-
+#endif
 	//----------------------------------------------------------
 	// If the context-sensitive menu is left around delete it...
 /*	if (CamelotContextMenu)
Index: Trunk/XaraLX/wxOil/camview.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camview.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/camview.cpp	(revision 1464)
@@ -133,6 +133,9 @@
 CC_IMPLEMENT_DYNAMIC( ViewDragTarget, OilDragTarget )
 CC_IMPLEMENT_DYNCREATE( PageDropInfo, CCObject )
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 // This user preference controls how many pixels the mouse must move before a
 // drag is initiated.
 INT32 CCamView::DragLatency = 3;
Index: Trunk/XaraLX/wxOil/camprofile.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camprofile.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/camprofile.cpp	(revision 1464)
@@ -112,6 +112,9 @@
 CC_IMPLEMENT_DYNCREATE(CamProfile, CCObject)
 CC_IMPLEMENT_DYNCREATE(CamProfiler, CCObject)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 CamProfile* CamProfile::pHead=NULL;
 CamProfile* CamProfile::pTail=NULL;
 CamProfile* CamProfile::pCurrent=NULL;
Index: Trunk/XaraLX/wxOil/ctrllist.cpp
===================================================================
--- Trunk/XaraLX/wxOil/ctrllist.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/ctrllist.cpp	(revision 1464)
@@ -106,6 +106,10 @@
 //#include "bars.h" - in camtypes.h [AUTOMATICALLY REMOVED]
 
 CC_IMPLEMENT_DYNCREATE(ControlList, CCObject)
+
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 ControlList * ControlList::m_pControlList = NULL;
 
 /********************************************************************************************
Index: Trunk/XaraLX/wxOil/camdoc.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camdoc.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/camdoc.cpp	(revision 1464)
@@ -114,6 +114,9 @@
 
 IMPLEMENT_DYNAMIC_CLASS( CCamDoc, wxDocument )
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 // Setting this to some document will force all CCamDoc's created by the
 // default constructor to attach to m_pForceDocument
 Document *CCamDoc::s_pForceDocument = NULL;
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1464)
@@ -151,6 +151,8 @@
 
 CC_IMPLEMENT_DYNAMIC(CGadgetImageList, CCObject);
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
 
 // Place all statics here please, ordered by class
 // Statics
Index: Trunk/XaraLX/wxOil/oilruler.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilruler.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/oilruler.cpp	(revision 1464)
@@ -156,6 +156,9 @@
 
 IMPLEMENT_DYNAMIC_CLASS(OILRuler, wxWindow)
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 BEGIN_EVENT_TABLE( OILRuler, wxWindow )
 	EVT_LEFT_DOWN( 		OILRuler::OnLButtonDown)
 	EVT_LEFT_DCLICK( 	OILRuler::OnLButtonDblClk)
Index: Trunk/XaraLX/wxOil/camframe.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camframe.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/camframe.cpp	(revision 1464)
@@ -123,6 +123,9 @@
 #include "ccolbar.h"
 #include "dragmgr.h"
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 #if defined(USE_WXAUI)
 
 class CamFrameManager : public wxFrameManager
Index: Trunk/XaraLX/wxOil/ccobject.cpp
===================================================================
--- Trunk/XaraLX/wxOil/ccobject.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/ccobject.cpp	(revision 1464)
@@ -996,7 +996,7 @@
 	void* pObject = NULL;
 
 	// Allocate memory for the new object.
-	pObject = CCObject::operator new(m_nObjectSize);
+	pObject = CCObject::operator new(m_nObjectSize, THIS_FILE, __LINE__);
 
 	// Attempt to construct it using dynamic creation facilities
 	if ((pObject != NULL) && ConstructObject(pObject))
Index: Trunk/XaraLX/wxOil/oilmods.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilmods.cpp	(revision 1463)
+++ Trunk/XaraLX/wxOil/oilmods.cpp	(revision 1464)
@@ -120,6 +120,9 @@
 
 DECLARE_SOURCE("$Revision$");
 
+// Declare smart memory handling in Debug builds
+#define new CAM_DEBUG_NEW
+
 // This list is always needed as RSN DLLs will hold resources even if the tool code
 // itself is in the .EXE
 


Xara