Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions code/model/modelread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "math/fvi.h"
#include "math/vecmat.h"
#include "model/model.h"
#include "model/modelrender.h"
#include "model/modelreplace.h"
#include "model/modelsinc.h"
#include "parse/parselo.h"
Expand Down Expand Up @@ -338,6 +339,10 @@ void model_instance_free_all()
{
size_t i;

// invalidate the UI render instance cache first so it doesn't retain stale references
// into Polygon_model_instances after the loop below
model_clear_cached_ui_render_instances();

// free any outstanding model instances
for ( i = 0; i < Polygon_model_instances.size(); ++i ) {
if ( Polygon_model_instances[i] ) {
Expand Down
Loading