Event Timeline
Comment Actions
https://github.com/0ad/0ad/blob/master/source/graphics/TextureManager.cpp
if (!m_DisableGL) { // Construct 1x1 24-bit texture shared_ptr<u8> data(new u8[3], ArrayDeleter()); data.get()[0] = 255; data.get()[1] = 0; data.get()[2] = 255; Tex t; (void)t.wrap(1, 1, 24, 0, data, 0); m_ErrorHandle = ogl_tex_wrap(&t, m_VFS, L"(error texture)"); (void)ogl_tex_set_filter(m_ErrorHandle, GL_LINEAR); if (!m_DisableGL) (void)ogl_tex_upload(m_ErrorHandle); // Construct a CTexture to return to callers who want an error texture CTextureProperties props(L"(error texture)"); m_ErrorTexture = CTexturePtr(new CTexture(m_ErrorHandle, props, this)); m_ErrorTexture->m_State = CTexture::LOADED; m_ErrorTexture->m_Self = m_ErrorTexture; }
if the array isn't freed that's three bytes lost each time