Made uiFree(NULL) illegal to spot bugs.

This commit is contained in:
Pietro Gagliardi 2015-05-07 17:45:34 -04:00
parent d853da9028
commit 727b6871bc
4 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,3 @@
- forbid free(NULL) to check for bugs
- opposite side alignment control in uiBox
- disabling containers on wine doesn't redraw children as disabled
- test on real windows

View File

@ -49,6 +49,6 @@ void *uiRealloc(void *p, size_t new)
void uiFree(void *p)
{
if (p == NULL)
return;
complain("attempt to uiFree(NULL); there's a bug somewhere");
free(BASE(p));
}

View File

@ -39,5 +39,7 @@ void *uiRealloc(void *p, size_t new)
void uiFree(void *p)
{
if (p == NULL)
complain("attempt to uiFree(NULL); there's a bug somewhere");
g_free(BASE(p));
}

View File

@ -44,7 +44,7 @@ void *uiRealloc(void *p, size_t size)
void uiFree(void *p)
{
if (p == NULL)
return;
complain("attempt to uiFree(NULL); there's a bug somewhere");
if (HeapFree(heap, 0, p) == 0)
logLastError("error freeing memory in uiFree()");
}