fixed so png files are closed after loading

This commit is contained in:
Choupom 2010-09-03 19:41:18 +02:00 committed by oy
parent 8522cab449
commit 44cf6acc3a

View file

@ -387,10 +387,16 @@ int CGraphics_OpenGL::LoadPNG(CImageInfo *pImg, const char *pFilename)
IOHANDLE File = m_pStorage->OpenFile(pFilename, IOFLAG_READ, aCompleteFilename, sizeof(aCompleteFilename));
if(File)
io_close(File);
else
{
dbg_msg("game/png", "failed to open file. filename='%s'", aCompleteFilename);
return 0;
}
if(png_open_file(&Png, aCompleteFilename) != PNG_NO_ERROR) // ignore_convention
{
dbg_msg("game/png", "failed to open file. filename='%s'", aCompleteFilename);
png_close_file(&Png); // ignore_convention
return 0;
}