sw_engine renderer: code refactoring

free the member resources in the destructor.
This commit is contained in:
Hermet Park 2021-11-09 16:09:44 +09:00
parent 4587a39f46
commit cbcb85cd7c

View file

@ -56,6 +56,11 @@ struct SwTask : Task
} }
virtual bool dispose() = 0; virtual bool dispose() = 0;
virtual ~SwTask()
{
free(transform);
}
}; };
@ -536,10 +541,8 @@ bool SwRenderer::dispose(RenderData data)
{ {
auto task = static_cast<SwTask*>(data); auto task = static_cast<SwTask*>(data);
if (!task) return true; if (!task) return true;
task->done(); task->done();
task->dispose(); task->dispose();
if (task->transform) free(task->transform);
delete(task); delete(task);
return true; return true;