Menu

I fixed 2 more buggs:

zhao lei
2009-04-12
2013-06-03
  • zhao lei

    zhao lei - 2009-04-12

    aiMaterial.h 473
       aiMaterial()
    // Added by zhaolei joy @2009.04.21
        {
            mProperties=NULL;
        }

    public:
        ~aiMaterial()
        {
            if(mProperties)
            {
                int index;
                for(index=0;index<mNumProperties;index++)
                {
                    delete mProperties[index];
                    mProperties[index]=NULL;
                }
                delete [] mProperties;
                mProperties=NULL;
            }
        }
    ===================================================
    objfiledata.h line 304
        ~Model()
        {
            //Added by zhaolei @ 2009.04.02
            {
                std::map<std::string, Material*>::iterator it=m_MaterialMap.begin();
                for(;it!=m_MaterialMap.end();it++)
                {
                    if(it->first.compare(std::string("defaultmaterial"))!=0)
                    {
                        delete it->second;
                        it->second=NULL;
                    }
                }
            }
            m_MaterialMap.clear();
            int index;
            for(index=0;index<m_Normals.size();index++)
            {
                delete m_Normals[index];
                m_Normals[index]=NULL;
            }
            m_Normals.clear();
            for(index=0;index<m_Vertices.size();index++)
            {
                delete m_Vertices[index];
                m_Vertices[index]=NULL;
            }
            m_Vertices.clear();
            for(index=0;index<m_TextureCoord.size();index++)
            {
                delete m_TextureCoord[index];
                m_TextureCoord[index]=NULL;
            }
            m_TextureCoord.clear();
    ==========================================

     
    • Alexander Gessler

      Hi,

      thanks for your feedback. Materials are internally represented by objects of class MaterialHelper and the allocation/deallocation stuff is handled by MaterialHelper, too. These memory leaks are already fixed in current SVN version.

      Regarding Obj -> yes, this is definitely an awkward flaw. I'll sent it over to the guy who wrote the OBJ loader for Assimp.

      Alex

       
    • zhao lei

      zhao lei - 2009-04-13

      okay, assimp will be better and beter ;-)

       
    • Kim Kulling

      Kim Kulling - 2009-04-16

      Hi,
      thanks for your bug reports :-). I found the reason in the obj-loader and will fix this as soon as possible ( it can take a little time, so thanks for your patience ).

      Kimmi

       

Log in to post a comment.