Sequence now exposed via shared_ptr instead of weak_ptr and memory release is done through destructor based on the isInit member variable

This commit is contained in:
Alejandro Saucedo 2020-11-01 20:25:15 +00:00
parent b0d394a50b
commit 473031d1f3
3 changed files with 38 additions and 31 deletions

View file

@ -27,9 +27,15 @@ Sequence::~Sequence()
{
SPDLOG_DEBUG("Kompute Sequence Destructor started");
if (!this->mIsInit) {
SPDLOG_WARN("Kompute Sequence destructor called but sequence is not initialized.");
return;
}
if (!this->mDevice) {
SPDLOG_ERROR(
"Kompute Sequence destructor reached with null Device pointer");
this->mIsInit = false;
return;
}
@ -38,6 +44,7 @@ Sequence::~Sequence()
if (!this->mCommandBuffer) {
SPDLOG_ERROR("Kompute Sequence destructor reached with null "
"CommandPool pointer");
this->mIsInit = false;
return;
}
this->mDevice->freeCommandBuffers(
@ -50,11 +57,14 @@ Sequence::~Sequence()
if (this->mCommandPool == nullptr) {
SPDLOG_ERROR("Kompute Sequence destructor reached with null "
"CommandPool pointer");
this->mIsInit = false;
return;
}
this->mDevice->destroy(*this->mCommandPool, (vk::Optional<const vk::AllocationCallbacks>)nullptr);
SPDLOG_DEBUG("Kompute Sequence Destroyed CommandPool");
}
this->mIsInit = false;
}
void