From: <au...@us...> - 2011-05-02 01:44:44
|
Revision: 8504 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8504&view=rev Author: auria Date: 2011-05-02 01:44:38 +0000 (Mon, 02 May 2011) Log Message: ----------- Fixed leak when using images with masks Modified Paths: -------------- main/trunk/src/graphics/material.cpp Modified: main/trunk/src/graphics/material.cpp =================================================================== --- main/trunk/src/graphics/material.cpp 2011-05-02 01:39:23 UTC (rev 8503) +++ main/trunk/src/graphics/material.cpp 2011-05-02 01:44:38 UTC (rev 8504) @@ -261,8 +261,16 @@ if (m_mask.size() > 0) { video::ITexture* tex = irr_driver->applyMask(m_texture, m_mask); - if (tex) m_texture = tex; - else fprintf(stderr, "Applying mask failed for '%s'!\n", m_texname.c_str()); + if (tex) + { + irr_driver->removeTexture(m_texture); + m_texture = tex; + } + else + { + fprintf(stderr, "Applying mask failed for '%s'!\n", m_texname.c_str()); + return; + } } m_texture->grab(); } // install This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |