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());
|
||||
for (const char* ext : m_device_extensions)
|
||||
os::Printer::log("Vulkan enabled extension", ext);
|
||||
|
||||
try
|
||||
{
|
||||
GEVulkanCommandLoader::init(this);
|
||||
createCommandBuffers();
|
||||
|
||||
@ -548,6 +551,12 @@ GEVulkanDriver::GEVulkanDriver(const SIrrlichtCreationParameters& params,
|
||||
GEVulkan2dRenderer::init(this);
|
||||
createUnicolorTextures();
|
||||
GEVulkanFeatures::printStats();
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
destroyVulkan();
|
||||
throw std::runtime_error("GEVulkanDriver constructor failed");
|
||||
}
|
||||
} // GEVulkanDriver
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user