Clean up properly in case constructor throws
This commit is contained in:
parent
22f658239f
commit
3d6c86d04e
@ -539,6 +539,9 @@ GEVulkanDriver::GEVulkanDriver(const SIrrlichtCreationParameters& params,
|
|||||||
os::Printer::log("Vulkan driver version", getDriverVersionString().c_str());
|
os::Printer::log("Vulkan driver version", getDriverVersionString().c_str());
|
||||||
for (const char* ext : m_device_extensions)
|
for (const char* ext : m_device_extensions)
|
||||||
os::Printer::log("Vulkan enabled extension", ext);
|
os::Printer::log("Vulkan enabled extension", ext);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
GEVulkanCommandLoader::init(this);
|
GEVulkanCommandLoader::init(this);
|
||||||
createCommandBuffers();
|
createCommandBuffers();
|
||||||
|
|
||||||
@ -548,6 +551,12 @@ GEVulkanDriver::GEVulkanDriver(const SIrrlichtCreationParameters& params,
|
|||||||
GEVulkan2dRenderer::init(this);
|
GEVulkan2dRenderer::init(this);
|
||||||
createUnicolorTextures();
|
createUnicolorTextures();
|
||||||
GEVulkanFeatures::printStats();
|
GEVulkanFeatures::printStats();
|
||||||
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
destroyVulkan();
|
||||||
|
throw std::runtime_error("GEVulkanDriver constructor failed");
|
||||||
|
}
|
||||||
} // GEVulkanDriver
|
} // GEVulkanDriver
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user