TheAssemblyArmada / Thyme

An open source re-implementation of Generals : Zero Hour written in C++.
GNU General Public License v2.0
584 stars 59 forks source link

Fix reference counting in HLodClass::Remove_Sub_Object #1140

Open xezon opened 3 months ago

xezon commented 3 months ago

Original call to single Release_Ref looks wrong to me, because m_lod[i][j].m_model and m_additionalModels[i].m_model are individually ref counted. So this looks like it would leak.

jonwil commented 3 months ago

I verified this against original and the code we have right now is correct to the original (i.e. the subobj->Release_Ref(); line)

xezon commented 3 months ago

Ok. Then perhaps this is original game bug. It would only lead to memory leak, not corruption, so it is not critical problem.