Hi !
I have memory leaks in this code, but I don't know how I could fix them.
Can you help me ?
DWORD WINAPI D3D11Rendering::texturesLoading(LPVOID lpParam)
{
LoadingThreadsParameters* parameters = (LoadingThreadsParameters*)lpParam;
for (unsigned short i = parameters->beginning; i <= parameters->end; i++)
{
string textureName(objectsData[i].textureName);
//_ASSERT(i != 236);
if (textureName.length() > 1)
{
string textureDirectory("./Assets/Textures/");
textureName.replace(textureName.length() - 4, 4, ".jpg");
string textureFilePath = textureDirectory + textureName;
// Load the texture and initialize an ID3D11Texture2D object.
HRESULT result = D3DX11CreateTextureFromFile(deviceDX11, textureFilePath.c_str(), NULL, NULL, (ID3D11Resource **)&textureData[i], NULL);
D3D11_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc;
// Fill in the D3D11_SHADER_RESOURCE_VIEW_DESC structure.
shaderResourceViewDesc.Format …