mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 11:36:25 +00:00
sw_engine renderer: code refactoring
free the member resources in the destructor.
This commit is contained in:
parent
4587a39f46
commit
cbcb85cd7c
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue