mirror of
https://github.com/rrika/cdcEngineDXHR.git
synced 2024-11-24 05:59:46 +00:00
fix memory leak (allocate from renderdevice doesn't call dtors)
This commit is contained in:
parent
4ac86ebb34
commit
5824d8c4dd
@ -547,6 +547,8 @@ int spinnyCube(HWND window,
|
||||
|
||||
static_cast<cdc::PCDX11RenderModelInstance*>(rmiDrawable.rmi)->baseMask = 0x1002; // normals & composite
|
||||
|
||||
std::vector<std::unique_ptr<RMIDrawableBase>> recycleRMI;
|
||||
|
||||
// all the other objects
|
||||
for (uint32_t i=introShowRange[0]; i<numIntros && i<introShowRange[1]; i++) {
|
||||
auto &intro = intros[i];
|
||||
@ -566,7 +568,8 @@ int spinnyCube(HWND window,
|
||||
if (renderModel) {
|
||||
// printf("%p %s\n", renderModel, typeid(*(cdc::RenderMesh*)renderModel).name());
|
||||
// printf("%p\n", renderModel->getMesh());
|
||||
auto *instanceRMIDrawable = new (renderDevice) RMIDrawableBase(renderModel);
|
||||
auto *instanceRMIDrawable = new RMIDrawableBase(renderModel);
|
||||
recycleRMI.emplace_back(instanceRMIDrawable);
|
||||
static_cast<cdc::PCDX11RenderModelInstance*>(instanceRMIDrawable->rmi)->baseMask = 0x1002; // normals & composite
|
||||
instanceRMIDrawable->draw(&instanceMatrix, 0.0f);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user