Use make_unique_nothrow instead of std::make_unique

This commit is contained in:
Maschell 2023-02-17 13:22:19 +01:00
parent b97c944dd6
commit 04c5f02682

View File

@ -124,7 +124,7 @@ std::optional<std::unique_ptr<PluginContainer>> PluginUtils::getPluginForBuffer(
std::vector<std::unique_ptr<PluginContainer>> PluginUtils::getLoadedPlugins(uint32_t maxSize) { std::vector<std::unique_ptr<PluginContainer>> PluginUtils::getLoadedPlugins(uint32_t maxSize) {
std::vector<std::unique_ptr<PluginContainer>> result; std::vector<std::unique_ptr<PluginContainer>> result;
auto handles = std::make_unique<plugin_container_handle[]>(maxSize); auto handles = make_unique_nothrow<plugin_container_handle[]>(maxSize);
if (!handles) { if (!handles) {
DEBUG_FUNCTION_LINE_ERR("Not enough memory"); DEBUG_FUNCTION_LINE_ERR("Not enough memory");
return result; return result;
@ -146,7 +146,7 @@ std::vector<std::unique_ptr<PluginContainer>> PluginUtils::getLoadedPlugins(uint
return result; return result;
} }
auto dataHandles = std::make_unique<plugin_data_handle[]>(realSize); auto dataHandles = make_unique_nothrow<plugin_data_handle[]>(realSize);
if (!dataHandles) { if (!dataHandles) {
DEBUG_FUNCTION_LINE_ERR("Not enough memory"); DEBUG_FUNCTION_LINE_ERR("Not enough memory");
return result; return result;
@ -157,7 +157,7 @@ std::vector<std::unique_ptr<PluginContainer>> PluginUtils::getLoadedPlugins(uint
return result; return result;
} }
auto information = std::make_unique<plugin_information[]>(realSize); auto information = make_unique_nothrow<plugin_information[]>(realSize);
if (!information) { if (!information) {
DEBUG_FUNCTION_LINE_ERR("Not enough memory"); DEBUG_FUNCTION_LINE_ERR("Not enough memory");
return result; return result;