GPU: Fix memory leak in VkShader.

std::string makes a copy, without taking ownership.
This commit is contained in:
Jeroen Bakker 2023-02-02 13:06:10 +01:00
parent 6c66f3e2b3
commit 644d54a193
1 changed files with 3 additions and 1 deletions

View File

@ -521,7 +521,9 @@ static char *glsl_patch_get()
static std::string combine_sources(Span<const char *> sources)
{
char *sources_combined = BLI_string_join_arrayN((const char **)sources.data(), sources.size());
return std::string(sources_combined);
std::string result(sources_combined);
MEM_freeN(sources_combined);
return result;
}
Vector<uint32_t> VKShader::compile_glsl_to_spirv(Span<const char *> sources,