mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00
common: fix returned value
In the case of requesting to unload a font that has not been previously loaded, InsufficientCondition should be returned, not InvalidArgument.
This commit is contained in:
parent
596845d1cf
commit
33640eae83
2 changed files with 2 additions and 1 deletions
|
@ -1637,6 +1637,7 @@ public:
|
||||||
* @retval Result::InvalidArguments If no name is provided or if @p size is zero while @p data points to a valid memory location.
|
* @retval Result::InvalidArguments If no name is provided or if @p size is zero while @p data points to a valid memory location.
|
||||||
* @retval Result::NonSupport When trying to load a file with an unsupported extension.
|
* @retval Result::NonSupport When trying to load a file with an unsupported extension.
|
||||||
* @retval Result::Unknown If an error occurs at a later stage.
|
* @retval Result::Unknown If an error occurs at a later stage.
|
||||||
|
* @retval Result::InsufficientCondition If attempting to unload the font data that has not been previously loaded.
|
||||||
*
|
*
|
||||||
* @warning: It's the user responsibility to release the @p data memory.
|
* @warning: It's the user responsibility to release the @p data memory.
|
||||||
*
|
*
|
||||||
|
|
|
@ -78,7 +78,7 @@ Result Text::load(const char* name, const char* data, uint32_t size, const strin
|
||||||
//unload font
|
//unload font
|
||||||
if (!data) {
|
if (!data) {
|
||||||
if (LoaderMgr::retrieve(name)) return Result::Success;
|
if (LoaderMgr::retrieve(name)) return Result::Success;
|
||||||
return Result::InvalidArguments;
|
return Result::InsufficientCondition;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LoaderMgr::loader(name, data, size, mimeType, copy)) return Result::NonSupport;
|
if (!LoaderMgr::loader(name, data, size, mimeType, copy)) return Result::NonSupport;
|
||||||
|
|
Loading…
Add table
Reference in a new issue