Better error handling

This commit is contained in:
twinaphex 2017-01-24 15:34:16 +01:00
parent a1a53e0043
commit 7e1c2a6657

View File

@ -612,8 +612,12 @@ int gwrom_init( gwrom_t* gwrom, void* data, size_t size, uint32_t flags )
void gwrom_destroy( gwrom_t* gwrom )
{
if (!gwrom)
return;
/* calls the destroy method */
gwrom->destroy( gwrom );
if (gwrom->destroy)
gwrom->destroy( gwrom );
/* free data */
if ( gwrom->flags & GWROM_FREE_DATA )