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:
@@ -1615,7 +1615,7 @@ CImageSample *CImageAllocator::CreateImageSample(LPBYTE pData,LONG Length)
|
||||
|
||||
// Allocate the new sample and check the return codes
|
||||
|
||||
pSample = new CImageSample((CBaseAllocator *) this, // Base class
|
||||
pSample = smnew CImageSample((CBaseAllocator *) this, // Base class
|
||||
NAME("Video sample"), // DEBUG name
|
||||
(HRESULT *) &hr, // Return code
|
||||
(LPBYTE) pData, // DIB address
|
||||
@@ -2023,7 +2023,7 @@ HPALETTE CImagePalette::MakePalette(const VIDEOINFOHEADER *pVideoInfo, LPSTR szD
|
||||
LOGPALETTE *lp; // Used to create a palette
|
||||
HPALETTE hPalette; // Logical palette object
|
||||
|
||||
lp = (LOGPALETTE *) new BYTE[sizeof(LOGPALETTE) + SIZE_PALETTE];
|
||||
lp = (LOGPALETTE *) smnew BYTE[sizeof(LOGPALETTE) + SIZE_PALETTE];
|
||||
if (lp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user