Fix crash due to accessing freed memory in Dx11 HLSL program class.
Min repro case:
compile a D3D11HLSLProgram based shader via prepare().
trigger an unload while state=LOADSTATE_PREPARED. (see Resource::unload () snip below)
this calls unprepareImpl() which only frees the cached string data and NOT the other 8 or so std::vectors.
call prepare() again. the program will crash due while iterating the std::vector data containing freed strings.
Resource::unload(void) calls either unprepareImpl() or unloadImpl () depending on the 'old' load state of a shader program.
if (old==LOADSTATE_PREPARED) {
unprepareImpl();
else
unloadImpl();
Fix crash due to accessing freed memory in Dx11 HLSL program class.
Min repro case:
Resource::unload(void) calls either unprepareImpl() or unloadImpl () depending on the 'old' load state of a shader program. if (old==LOADSTATE_PREPARED) { unprepareImpl(); else unloadImpl();