[commit] r2731 - trunk/SDK/DecoratorLib

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Feb 5 11:27:54 CST 2018


Author: ksmyth
Date: Mon Feb  5 11:27:54 2018
New Revision: 2731

Log:
Fix memory errors

Modified:
   trunk/SDK/DecoratorLib/BitmapUtil.cpp
   trunk/SDK/DecoratorLib/ClassComplexPart.cpp

Modified: trunk/SDK/DecoratorLib/BitmapUtil.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/BitmapUtil.cpp	Wed Jan 24 11:07:16 2018	(r2730)
+++ trunk/SDK/DecoratorLib/BitmapUtil.cpp	Mon Feb  5 11:27:54 2018	(r2731)
@@ -634,13 +634,13 @@
 	// Make sure all member data that might have been allocated is freed.
 	if(m_pBMI)
 	{
-		delete m_pBMI;
+		delete[] m_pBMI;
 		m_pBMI = NULL;
 	}
 	
 	if(m_pBits)
 	{
-		delete m_pBits;
+		delete[] m_pBits;
 		m_pBits = NULL;
 	}
 	if(m_pPalette)

Modified: trunk/SDK/DecoratorLib/ClassComplexPart.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/ClassComplexPart.cpp	Wed Jan 24 11:07:16 2018	(r2730)
+++ trunk/SDK/DecoratorLib/ClassComplexPart.cpp	Mon Feb  5 11:27:54 2018	(r2731)
@@ -1274,6 +1274,8 @@
 	long numberOfGaps = 0;
 	long heightPreEstimation = m_DecoratorMarginY;
 	if (m_LabelPart != NULL) {
+		// GetTextLocation calculation depends on SetTextRelYPosition
+		m_LabelPart->SetTextRelYPosition(0);
 		CRect labelLoc = m_LabelPart->GetTextLocation(pDC, gdip);
 		m_lMaxTextWidth = max(m_lMaxTextWidth, labelLoc.Width());
 		m_lMaxTextHeight = max(m_lMaxTextHeight, labelLoc.Height());
@@ -1281,6 +1283,8 @@
 	}
 
 	if (m_StereotypePart != NULL) {
+		// GetTextLocation calculation depends on SetTextRelYPosition
+		m_StereotypePart->SetTextRelYPosition(0);
 		CRect stereoLoc = m_StereotypePart->GetTextLocation(pDC, gdip);
 		m_lMaxTextWidth = max(m_lMaxTextWidth, stereoLoc.Width());
 		m_lMaxTextHeight = max(m_lMaxTextHeight, stereoLoc.Height());


More information about the gme-commit mailing list