mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
common: ++exception handling.
fix the memory leak in the corner case detected by tvg test suites @Issue: https://github.com/Samsung/thorvg/issues/995
This commit is contained in:
parent
00bba39b02
commit
37e39866dd
1 changed files with 3 additions and 0 deletions
|
@ -110,9 +110,12 @@ Result Saver::save(std::unique_ptr<Paint> paint, const string& path, bool compre
|
||||||
pImpl->saveModule = saveModule;
|
pImpl->saveModule = saveModule;
|
||||||
return Result::Success;
|
return Result::Success;
|
||||||
} else {
|
} else {
|
||||||
|
delete(p);
|
||||||
|
delete(saveModule);
|
||||||
return Result::Unknown;
|
return Result::Unknown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete(p);
|
||||||
return Result::NonSupport;
|
return Result::NonSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue