Here is the code a commented to get a clean exit.
void Shape::CreateType1(void){ m_bIsActive = true; float XAdd = 33.3f; Block *newBlock1 = new Block(m_pD3DDevice, m_txtBlueBlock->GetTexture()); /*Block *newBlock2 = new Block(m_pD3DDevice, m_txtBlueBlock->GetTexture()); Block *newBlock3 = new Block(m_pD3DDevice, m_txtBlueBlock->GetTexture()); Block *newBlock4 = new Block(m_pD3DDevice, m_txtBlueBlock->GetTexture()); Block *newBlock5 = new Block(m_pD3DDevice, m_txtBlueBlock->GetTexture()); newBlock1->SetAbsoluteTranslation(START_OFFSET_X, START_OFFSET_Y, 0.0f); newBlock2->SetAbsoluteTranslation(START_OFFSET_X + XAdd, START_OFFSET_Y, 0.0f); XAdd += 33.3f; newBlock3->SetAbsoluteTranslation(START_OFFSET_X + XAdd, START_OFFSET_Y, 0.0f); XAdd += 33.3f; newBlock4->SetAbsoluteTranslation(START_OFFSET_X + XAdd, START_OFFSET_Y, 0.0f); XAdd += 33.3f; newBlock5->SetAbsoluteTranslation(START_OFFSET_X + XAdd, START_OFFSET_Y, 0.0f);*/ /*m_smgr->Add(newBlock1); m_smgr->Add(newBlock2); m_smgr->Add(newBlock3); m_smgr->Add(newBlock4); m_smgr->Add(newBlock5);*/ /*m_Blocks.push_back(newBlock1); m_Blocks.push_back(newBlock2); m_Blocks.push_back(newBlock3); m_Blocks.push_back(newBlock4); m_Blocks.push_back(newBlock5);*/ newBlock1->Shutdown(); //NEW delete newBlock1; }
If I take that part out of the local method it gives me the error. So I push it back into the vector and call that Delete() class, it deletes it but it still comes back with the error. I am going crazy. If you would like me to post my whole game code, library and all. Let me know, because I cannot figure this out for the life of me.