Made uiFree(NULL) illegal to spot bugs.
This commit is contained in:
parent
d853da9028
commit
727b6871bc
1
TODO.md
1
TODO.md
|
@ -1,4 +1,3 @@
|
||||||
- forbid free(NULL) to check for bugs
|
|
||||||
- opposite side alignment control in uiBox
|
- opposite side alignment control in uiBox
|
||||||
- disabling containers on wine doesn't redraw children as disabled
|
- disabling containers on wine doesn't redraw children as disabled
|
||||||
- test on real windows
|
- test on real windows
|
||||||
|
|
|
@ -49,6 +49,6 @@ void *uiRealloc(void *p, size_t new)
|
||||||
void uiFree(void *p)
|
void uiFree(void *p)
|
||||||
{
|
{
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return;
|
complain("attempt to uiFree(NULL); there's a bug somewhere");
|
||||||
free(BASE(p));
|
free(BASE(p));
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,5 +39,7 @@ void *uiRealloc(void *p, size_t new)
|
||||||
|
|
||||||
void uiFree(void *p)
|
void uiFree(void *p)
|
||||||
{
|
{
|
||||||
|
if (p == NULL)
|
||||||
|
complain("attempt to uiFree(NULL); there's a bug somewhere");
|
||||||
g_free(BASE(p));
|
g_free(BASE(p));
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ void *uiRealloc(void *p, size_t size)
|
||||||
void uiFree(void *p)
|
void uiFree(void *p)
|
||||||
{
|
{
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return;
|
complain("attempt to uiFree(NULL); there's a bug somewhere");
|
||||||
if (HeapFree(heap, 0, p) == 0)
|
if (HeapFree(heap, 0, p) == 0)
|
||||||
logLastError("error freeing memory in uiFree()");
|
logLastError("error freeing memory in uiFree()");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue