File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1132,21 +1132,12 @@ void CMP_CMIPS::FreeMipSet(CMP_MipSet* pMipSet)
11321132
11331133 for (int i = 0 ; i < nTotalOldMipLevels; i++)
11341134 {
1135- // Clean up m_pvec8Data if it was allocated
1136- if (pMipSet->m_pMipLevelTable [i]->m_pvec8Data )
1137- {
1138- delete pMipSet->m_pMipLevelTable [i]->m_pvec8Data ;
1139- pMipSet->m_pMipLevelTable [i]->m_pvec8Data = NULL ;
1140- }
1141-
1142- if (pMipSet->m_pMipLevelTable [i]->m_pbData )
1143- {
1144- free (pMipSet->m_pMipLevelTable [i]->m_pbData );
1145- pMipSet->m_pMipLevelTable [i]->m_pbData = NULL ;
1146- }
1147-
11481135 if (pMipSet->m_pMipLevelTable [i])
11491136 {
1137+ // Use the dedicated function to clean up MipLevel data
1138+ FreeMipLevelData (pMipSet->m_pMipLevelTable [i]);
1139+
1140+ // Free the MipLevel structure itself
11501141 free (pMipSet->m_pMipLevelTable [i]);
11511142 pMipSet->m_pMipLevelTable [i] = NULL ;
11521143 }
@@ -1162,6 +1153,13 @@ void CMP_CMIPS::FreeMipSet(CMP_MipSet* pMipSet)
11621153
11631154void CMP_CMIPS::FreeMipLevelData (CMP_MipLevel* pMipLevel)
11641155{
1156+ // Clean up m_pvec8Data if it was allocated
1157+ if (pMipLevel->m_pvec8Data )
1158+ {
1159+ delete pMipLevel->m_pvec8Data ;
1160+ pMipLevel->m_pvec8Data = NULL ;
1161+ }
1162+
11651163 if (pMipLevel->m_pbData )
11661164 {
11671165 free (pMipLevel->m_pbData );
You can’t perform that action at this time.
0 commit comments