Calling init repeatedly doesn't increment count.
This leads to unwanted termination due to mismatch of the pair.
if (nonSupport) return Result::NonSupport;
- if (_initCnt > 0) return Result::Success;
- ++_initCnt;
+ if (_initCnt++ > 0) return Result::Success;
if (!LoaderMgr::init()) return Result::Unknown;
if (nonSupport) return Result::NonSupport;
- --_initCnt;
- if (_initCnt > 0) return Result::Success;
+ if (--_initCnt > 0) return Result::Success;
TaskScheduler::term();