We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 60203b6 + 96d1988 commit d4c21ecCopy full SHA for d4c21ec
1 file changed
code/model/modelread.cpp
@@ -31,6 +31,7 @@
31
#include "math/fvi.h"
32
#include "math/vecmat.h"
33
#include "model/model.h"
34
+#include "model/modelrender.h"
35
#include "model/modelreplace.h"
36
#include "model/modelsinc.h"
37
#include "parse/parselo.h"
@@ -338,6 +339,10 @@ void model_instance_free_all()
338
339
{
340
size_t i;
341
342
+ // invalidate the UI render instance cache first so it doesn't retain stale references
343
+ // into Polygon_model_instances after the loop below
344
+ model_clear_cached_ui_render_instances();
345
+
346
// free any outstanding model instances
347
for ( i = 0; i < Polygon_model_instances.size(); ++i ) {
348
if ( Polygon_model_instances[i] ) {
0 commit comments