Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
[HEVCe/lib] Fix kw issue for unique pointer reset and initialization
Browse files Browse the repository at this point in the history
1.Defer unique pointer reset after the argument be used
2.Change variable Initialization from constructor to declaration
  • Loading branch information
LightnyIntel authored and dmitryermilov committed Dec 21, 2021
1 parent 671fd7e commit 0db73aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ IAllocation* Allocator::MakeAlloc(std::unique_ptr<MfxEncodeHW::ResPool>&& upAllo
return nullptr;

auto pAlloc = upAlloc.release();
pIAlloc->m_pthis.reset(pAlloc);

#define WRAP_CC(X) pIAlloc->X.Push(WrapCC(&MfxEncodeHW::ResPool::X, pAlloc))
WRAP_CC(Alloc);
Expand All @@ -69,6 +68,8 @@ IAllocation* Allocator::MakeAlloc(std::unique_ptr<MfxEncodeHW::ResPool>&& upAllo
WRAP_CC(UnlockAll);
WRAP_CC(Acquire);

pIAlloc->m_pthis.reset(pAlloc);

return pIAlloc.release();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ using namespace HEVCEHW::Base;

MFXVideoENCODEH265_HW::MFXVideoENCODEH265_HW(VideoCORE& core)
: m_core(core)
, m_runtimeErr(MFX_ERR_NONE)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace Base
VideoCORE& m_core;
TFeatureList m_features;
StorageRW m_storage;
mfxStatus m_runtimeErr;
mfxStatus m_runtimeErr = MFX_ERR_NONE;

mfxStatus Execute(mfxThreadTask task, mfxU32 uid_p, mfxU32 uid_a);
mfxStatus FreeResources(mfxThreadTask task, mfxStatus sts);
Expand Down

0 comments on commit 0db73aa

Please sign in to comment.