zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
114 stars 22 forks source link

Undo::size double-counts owned memory in most cases #128

Open m-7761 opened 4 years ago

m-7761 commented 4 years ago

For example, MU_AddPoint::size and MU_DeletePoint::size both includes sizeof(Model::Point) in their size totals.

Obviously it will be a PITA to try to correct this, so in the meantime it's safe to say the reported sizes are inaccurate.

I say this because I'm unsure what the purpose of this is. Obviously when an undo object owns the memory it should include its size, but probably not if the memory is represented in the model's size, but I don't know what the memory is meant to represent.

Obviously if you Add+Delete a point it doesn't make sense to report the size of two points objects.

EDITED: I think it's relate to Undo::undoRelease and Undo::redoRelease. It might make sense if Undo::size could tell if it was in the undo or redo stack to include the owned memory. I still don't know exactly; just reporting there's a relationship there.