mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 14:48:24 +00:00
common Initializer: Fix init count
Calling init repeatedly doesn't increment count. This leads to unwanted termination due to mismatch of the pair.
This commit is contained in:
parent
fbd24c3c93
commit
ed8dfbc529
1 changed files with 2 additions and 4 deletions
|
@ -63,8 +63,7 @@ Result Initializer::init(CanvasEngine engine, uint32_t threads) noexcept
|
|||
|
||||
if (nonSupport) return Result::NonSupport;
|
||||
|
||||
if (_initCnt > 0) return Result::Success;
|
||||
++_initCnt;
|
||||
if (_initCnt++ > 0) return Result::Success;
|
||||
|
||||
if (!LoaderMgr::init()) return Result::Unknown;
|
||||
|
||||
|
@ -96,8 +95,7 @@ Result Initializer::term(CanvasEngine engine) noexcept
|
|||
|
||||
if (nonSupport) return Result::NonSupport;
|
||||
|
||||
--_initCnt;
|
||||
if (_initCnt > 0) return Result::Success;
|
||||
if (--_initCnt > 0) return Result::Success;
|
||||
|
||||
TaskScheduler::term();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue