Commit e5e4e12c authored by anotherguest's avatar anotherguest

FForgot to delete those animations and frames properly.

parent 4c459787
......@@ -50,7 +50,6 @@ SceneFrame::SceneFrame(int frameType, unsigned char* frameData, int frameSize) {
SceneFrame::~SceneFrame() {
delete [] frameData;
if (next) delete next;
}
void SceneAnimation::addFrame(int frameType, unsigned char* frameData, int frameSize) {
......@@ -94,7 +93,17 @@ SceneAnimation::~SceneAnimation ()
{
if (next) delete next;
if(sceneFrames) delete sceneFrames;
if(sceneFrames) {
SceneFrame* frame = sceneFrames;
SceneFrame* nextFrame = NULL;
while(frame)
{
nextFrame = frame->next;
delete frame;
frame = NULL;
frame = nextFrame;
}
}
if (background) SDL_FreeSurface(background);
}
......@@ -235,6 +244,7 @@ Scene::~Scene () {
if (images) delete images;
if (palettes) delete palettes;
if (animations) delete animations;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment