diff --git a/new/GNUmakefile b/new/GNUmakefile index aa01f372..bb3fd6a4 100644 --- a/new/GNUmakefile +++ b/new/GNUmakefile @@ -24,6 +24,7 @@ baseHFILES = \ baseCFILES = \ box.c \ + lifetimes.c \ $(osCFILES) baseMFILES = $(osMFILES) diff --git a/new/lifetimes.c b/new/lifetimes.c new file mode 100644 index 00000000..efeb1f34 --- /dev/null +++ b/new/lifetimes.c @@ -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); +} diff --git a/new/uipriv.h b/new/uipriv.h index 4908ccaf..cc3d672a 100644 --- a/new/uipriv.h +++ b/new/uipriv.h @@ -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 *);