[GME-commit] GMESRC/GME/Gme PreviewWnd.h,1.1,1.2 PreviewWnd.cpp,1.3,1.4

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu May 27 18:05:43 CDT 2004


Update of /var/lib/gme/GMESRC/GME/Gme
In directory braindrain:/tmp/cvs-serv19952

Modified Files:
	PreviewWnd.h PreviewWnd.cpp 
Log Message:
CreateCompatibleBitmap leak corrected

CVS User: bogyom

Index: PreviewWnd.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/PreviewWnd.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PreviewWnd.h	25 Feb 2004 18:08:24 -0000	1.1
--- PreviewWnd.h	27 May 2004 22:05:23 -0000	1.2
***************
*** 19,23 ****
  // Attributes
  public:
! 	void SetDC(CDC *bitmapDC) {if (m_bitmapDC) delete m_bitmapDC; m_bitmapDC = bitmapDC;}
  	void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
  
--- 19,33 ----
  // Attributes
  public:
! 	void SetDC(CDC *bitmapDC) 
! 	{
! 		if (m_bitmapDC) 
! 		{
! 			CBitmap *bmp = m_bitmapDC->GetCurrentBitmap();
! 			delete m_bitmapDC; 
! 			if (bmp)
! 				delete bmp;
! 		}
! 		m_bitmapDC = bitmapDC;
! 	}
  	void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
  

Index: PreviewWnd.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/PreviewWnd.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PreviewWnd.cpp	18 May 2004 13:30:59 -0000	1.3
--- PreviewWnd.cpp	27 May 2004 22:05:23 -0000	1.4
***************
*** 22,26 ****
  CPreviewBtn::~CPreviewBtn()
  {
! 	delete m_bitmapDC;
  }
  
--- 22,32 ----
  CPreviewBtn::~CPreviewBtn()
  {
! 	if (m_bitmapDC) 
! 	{
! 		CBitmap *bmp = m_bitmapDC->GetCurrentBitmap();
! 		delete m_bitmapDC; 
! 		if (bmp)
! 			delete bmp;
! 	}
  }
  



More information about the GME-commit mailing list