mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-26 08:42:19 +00:00
[CHG] Make sure a NULL pointer is not free'd
This commit is contained in:
parent
c8abda9052
commit
34a1991cd9
2 changed files with 10 additions and 10 deletions
|
@ -165,6 +165,6 @@ void GRRLIB_Exit (void) {
|
|||
|
||||
// Free up memory allocated for frame buffers & FIFOs
|
||||
if (xfb[0] != NULL) { free(MEM_K1_TO_K0(xfb[0])); xfb[0] = NULL; }
|
||||
if (xfb[1] != NULL) { free(MEM_K1_TO_K0(xfb[1])); xfb[0] = NULL; }
|
||||
if (xfb[1] != NULL) { free(MEM_K1_TO_K0(xfb[1])); xfb[1] = NULL; }
|
||||
if (gp_fifo != NULL) { free(gp_fifo); gp_fifo = NULL; }
|
||||
}
|
||||
|
|
|
@ -73,17 +73,17 @@ void GRRLIB_FlushTex (GRRLIB_texImg *tex) {
|
|||
*/
|
||||
INLINE
|
||||
void GRRLIB_FreeTexture (GRRLIB_texImg *tex) {
|
||||
if(tex != NULL) {
|
||||
free(tex->data);
|
||||
free(tex);
|
||||
tex = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
* Clear a texture to transparent black
|
||||
* @param tex : Texture to clear
|
||||
* Clear a texture to transparent black.
|
||||
* @param tex Texture to clear.
|
||||
*/
|
||||
//==============================================================================
|
||||
INLINE
|
||||
void GRRLIB_ClearTex(GRRLIB_texImg* tex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue