RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.37k stars 244 forks source link

idClipModel::FreeTraceModel: tried to free uncached trace model #860

Closed SRSaunders closed 2 months ago

SRSaunders commented 2 months ago

I have always wondered about this warning on exit. Turns out this happens when exiting a level (or game) that has been loaded from a savefile. Problem is that traceModelCache[]->refCount associated with the defaultClipModel is not being set properly after a load from file. It is set to 0 and never incremented (i.e. not ref'd by objects) which results in this warning message on exit. Solution is pretty straight forward: fix the refCount on load. I will submit a PR to solve.