mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-10 06:34:01 +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 ~SwTask()
|
||||
{
|
||||
free(transform);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -536,10 +541,8 @@ bool SwRenderer::dispose(RenderData data)
|
|||
{
|
||||
auto task = static_cast<SwTask*>(data);
|
||||
if (!task) return true;
|
||||
|
||||
task->done();
|
||||
task->dispose();
|
||||
if (task->transform) free(task->transform);
|
||||
delete(task);
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue