fixed memory leak

This commit is contained in:
andreja6
2019-11-11 14:13:36 -08:00
parent 152b376c02
commit 3035478c77
2 changed files with 8 additions and 1 deletions

View File

@@ -603,7 +603,9 @@ void Application::onGraphics(RenderDevice* rd) {
glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_NORMAL_ARRAY);
//if(_dataModel->getWorkspace() != NULL)
_dataModel->getWorkspace()->render(rd); _dataModel->getWorkspace()->render(rd);
//else throw std::exception("Workspace not found");
glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_NORMAL_ARRAY);

View File

@@ -62,7 +62,12 @@ void GUDButtonListener::onButton1MouseClick(BaseButtonInstance* button)
if(g_selectedInstances.at(i)->canDelete) if(g_selectedInstances.at(i)->canDelete)
{ {
if(GroupInstance* model = dynamic_cast<GroupInstance*>(g_selectedInstances.at(i))) if(GroupInstance* model = dynamic_cast<GroupInstance*>(g_selectedInstances.at(i)))
{
newinst = model->unGroup(); newinst = model->unGroup();
model->setParent(NULL);
delete model;
model = NULL;
}
} }
/*tempinst->setPosition(Vector3(tempPos.x, tempPos.y + tempSize.y, tempPos.z)); /*tempinst->setPosition(Vector3(tempPos.x, tempPos.y + tempSize.y, tempPos.z));
g_usableApp->cameraController.centerCamera(g_selectedInstances.at(0));*/ g_usableApp->cameraController.centerCamera(g_selectedInstances.at(0));*/