Added a lifeline to keep my sanity about lifetimes. Not sure if this will stay or not...

This commit is contained in:
Pietro Gagliardi 2015-04-25 18:33:36 -04:00
parent 335bfe8b1a
commit 8a10f90336
3 changed files with 15 additions and 0 deletions

View File

@ -24,6 +24,7 @@ baseHFILES = \
baseCFILES = \
box.c \
lifetimes.c \
$(osCFILES)
baseMFILES = $(osMFILES)

11
new/lifetimes.c Normal file
View File

@ -0,0 +1,11 @@
// 25 april 2015
#include "ui.h"
#include "uipriv.h"
// called by uiParentDestroy() and any container control in its uiControlDestroy()
void properlyDestroyControl(uiControl *c)
{
uiControlSetOSContainer(c, NULL);
uiControlSetHasParent(c, 0);
uiControlDestroy(c);
}

View File

@ -9,3 +9,6 @@ extern void *uiRealloc(void *, size_t, const char *);
extern void uiFree(void *);
extern void complain(const char *, ...);
// lifetimes.c
extern void properlyDestroyControl(uiControl *);