mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-22 23:12:21 +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
|
// Free up memory allocated for frame buffers & FIFOs
|
||||||
if (xfb[0] != NULL) { free(MEM_K1_TO_K0(xfb[0])); xfb[0] = NULL; }
|
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; }
|
if (gp_fifo != NULL) { free(gp_fifo); gp_fifo = NULL; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,17 +73,17 @@ void GRRLIB_FlushTex (GRRLIB_texImg *tex) {
|
||||||
*/
|
*/
|
||||||
INLINE
|
INLINE
|
||||||
void GRRLIB_FreeTexture (GRRLIB_texImg *tex) {
|
void GRRLIB_FreeTexture (GRRLIB_texImg *tex) {
|
||||||
|
if(tex != NULL) {
|
||||||
free(tex->data);
|
free(tex->data);
|
||||||
free(tex);
|
free(tex);
|
||||||
tex = NULL;
|
tex = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
/**
|
/**
|
||||||
* Clear a texture to transparent black
|
* Clear a texture to transparent black.
|
||||||
* @param tex : Texture to clear
|
* @param tex Texture to clear.
|
||||||
*/
|
*/
|
||||||
//==============================================================================
|
|
||||||
INLINE
|
INLINE
|
||||||
void GRRLIB_ClearTex(GRRLIB_texImg* tex)
|
void GRRLIB_ClearTex(GRRLIB_texImg* tex)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue