mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed so png files are closed after loading
This commit is contained in:
parent
8522cab449
commit
44cf6acc3a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue