From 952a407f3eef181127f2b06a2a7dc3500f8ec692 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 12 Jun 2025 08:48:26 +0200 Subject: [PATCH] Clear mesh callbacks on clone --- miniwin/src/d3drm/d3drmmesh.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miniwin/src/d3drm/d3drmmesh.cpp b/miniwin/src/d3drm/d3drmmesh.cpp index 653f993d..8d1d7876 100644 --- a/miniwin/src/d3drm/d3drmmesh.cpp +++ b/miniwin/src/d3drm/d3drmmesh.cpp @@ -25,6 +25,9 @@ HRESULT Direct3DRMMeshImpl::Clone(int flags, GUID iid, void** object) auto* clone = new Direct3DRMMeshImpl(*this); + // We should not call the other meshes callbacks + clone->m_callbacks.clear(); + for (auto& group : clone->m_groups) { // Reusing the same texture and material on the new mesh instead of cloning them might not be correct if (group.texture) {