No idea where it leaked.

Started by
11 comments, last by lucky6969b 11 years, 2 months ago

struct BoneMesh: public D3DXMESHCONTAINER
{
    ID3DXMesh* OriginalMesh;
    std::vector<D3DMATERIAL9> materials; <<<<<<<<<<<
    std::vector<IDirect3DTexture9*> textures; <<<<<<<<<<< these two annoying lines leak

    DWORD NumAttributeGroups;
    D3DXATTRIBUTERANGE* attributeTable;
    D3DXMATRIX** boneMatrixPtrs;
    D3DXMATRIX* boneOffsetMatrices;
    D3DXMATRIX* currentBoneMatrices;

    BoneMesh()
    {
        OriginalMesh = NULL;

    
        NumAttributeGroups = 0;
        attributeTable = NULL;
        boneMatrixPtrs = NULL;
        boneOffsetMatrices = NULL;
        currentBoneMatrices = NULL;
    }
};
Advertisement

Uhm. You have no destructor function in BoneMesh, which means you are not calling Release() on the IDirect3DTexture9's. If you're calling delete on the bone mesh (and not it's base type), then the materials array should be handled already.

Thanks, it was it, I created a destructor and eliminated other stuff in DestroyMeshContainer and all leaks went away.

Jack

This topic is closed to new replies.

Advertisement