[GME-commit] GMESRC/GME/Gme PannButton.cpp,1.7,1.8 GMEView.cpp,1.149,1.150

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu May 27 17:48:19 CDT 2004


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

Modified Files:
	PannButton.cpp GMEView.cpp 
Log Message:
Panning window leaking corrected


CVS User: bogyom

Index: PannButton.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/PannButton.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PannButton.cpp	18 May 2004 13:30:59 -0000	1.7
--- PannButton.cpp	27 May 2004 21:48:10 -0000	1.8
***************
*** 36,40 ****
--- 36,45 ----
  {
  	if (m_bitmapDC)
+ 	{
+ 		CBitmap *bmp = m_bitmapDC->GetCurrentBitmap();
  		delete m_bitmapDC;
+ 		if (bmp)
+ 			delete bmp;
+ 	}
  }
  
***************
*** 63,69 ****
  	TRACE("SetBitmapDC\n");
  	if (m_bitmapDC)
  		delete m_bitmapDC;
! 	m_owner = owner;
  	m_bitmapDC = bdc; 
  	m_bitmapSizeOri = orisize;
  	m_bitmapSizeStored = actsize;
--- 68,79 ----
  	TRACE("SetBitmapDC\n");
  	if (m_bitmapDC)
+ 	{
+ 		CBitmap *bmp = m_bitmapDC->GetCurrentBitmap();
  		delete m_bitmapDC;
! 		if (bmp)
! 			delete bmp;
! 	}
  	m_bitmapDC = bdc; 
+ 	m_owner = owner;
  	m_bitmapSizeOri = orisize;
  	m_bitmapSizeStored = actsize;
***************
*** 159,164 ****
  	bmpToScreen(clientr);
  	// TODO: Error checking
! 	dc.StretchBlt(0, 0, m_bitmapOnScreen.Width(), m_bitmapOnScreen.Height(), m_bitmapDC, 
  							 0, 0, m_bitmapSizeStored.Width(), m_bitmapSizeStored.Height(), SRCCOPY);
  	CBrush brush1;
  	DWORD dw1 = GetSysColor(COLOR_WINDOWTEXT);
--- 169,175 ----
  	bmpToScreen(clientr);
  	// TODO: Error checking
! 	BOOL ret = dc.StretchBlt(0, 0, m_bitmapOnScreen.Width(), m_bitmapOnScreen.Height(), m_bitmapDC, 
  							 0, 0, m_bitmapSizeStored.Width(), m_bitmapSizeStored.Height(), SRCCOPY);
+ 	ASSERT(ret);
  	CBrush brush1;
  	DWORD dw1 = GetSysColor(COLOR_WINDOWTEXT);

Index: GMEView.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.149
retrieving revision 1.150
diff -C2 -d -r1.149 -r1.150
*** GMEView.cpp	18 May 2004 13:30:59 -0000	1.149
--- GMEView.cpp	27 May 2004 21:48:10 -0000	1.150
***************
*** 483,487 ****
  // CGMEView drawing
  
! #define PANNING_RATIO	3 // ??
  void CGMEView::DoPannWinRefresh()
  {
--- 483,487 ----
  // CGMEView drawing
  
! #define PANNING_RATIO_MIN	4 // ??
  void CGMEView::DoPannWinRefresh()
  {
***************
*** 500,507 ****
  	extent.bottom = (int)(extent.bottom*EXTENT_ERROR_CORR); // ??
  	
! 	CRect target = CRect(0, 0, extent.Width()/PANNING_RATIO, extent.Height()/PANNING_RATIO);
  
  	// make a bitmap DC
  	CDC *pannDC = new CDC();
  	CClientDC tmpDC(this);
  
--- 500,508 ----
  	extent.bottom = (int)(extent.bottom*EXTENT_ERROR_CORR); // ??
  	
! 	CRect target = CRect(0, 0, extent.Width()/PANNING_RATIO_MIN, extent.Height()/PANNING_RATIO_MIN);
  
  	// make a bitmap DC
  	CDC *pannDC = new CDC();
+ 	ASSERT(pannDC != NULL);
  	CClientDC tmpDC(this);
  
***************
*** 509,515 ****
  	pannDC->CreateCompatibleDC(&tmpDC);
  	CBitmap * pannBmp = new CBitmap();
  
  	// TODO: Error checking
! 	pannBmp->CreateCompatibleBitmap(&tmpDC, target.Width(), target.Height());
  	pannDC->SelectObject(pannBmp);
  
--- 510,518 ----
  	pannDC->CreateCompatibleDC(&tmpDC);
  	CBitmap * pannBmp = new CBitmap();
+ 	ASSERT(pannBmp != NULL);
  
  	// TODO: Error checking
! 	BOOL ret = pannBmp->CreateCompatibleBitmap(&tmpDC, target.Width(), target.Height());
! 	ASSERT(ret);
  	pannDC->SelectObject(pannBmp);
  



More information about the GME-commit mailing list