Removed uiControlVerifyDestroy(); we could have just had it in uiFreeControl().

This commit is contained in:
Pietro Gagliardi 2016-05-22 01:07:25 -04:00
parent 1c2acf59a3
commit 1d8ea79e45
7 changed files with 5 additions and 11 deletions

View File

@ -12,7 +12,10 @@ This README is being written.<br>
## Updates
(none yet)
> Note that today's entry may be updated later today.
* **22 May 2016**
** Removed `uiControlVerifyDestroy()`; that is now part of `uiFreeControl()` itself.
## Runtime Requirements

View File

@ -71,14 +71,10 @@ uiControl *uiAllocControl(size_t size, uint32_t OSsig, uint32_t typesig, const c
}
void uiFreeControl(uiControl *c)
{
uiFree(c);
}
void uiControlVerifyDestroy(uiControl *c)
{
if (uiControlParent(c) != NULL)
userbug("You cannot destroy a uiControl while it still has a parent. (control: %p)", c);
uiFree(c);
}
void uiControlVerifySetParent(uiControl *c, uiControl *parent)

1
ui.h
View File

@ -77,7 +77,6 @@ _UI_EXTERN uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig,
_UI_EXTERN void uiFreeControl(uiControl *);
// TODO make sure all controls have these
_UI_EXTERN void uiControlVerifyDestroy(uiControl *);
_UI_EXTERN void uiControlVerifySetParent(uiControl *, uiControl *);
_UI_EXTERN int uiControlEnabledToUser(uiControl *);

View File

@ -38,7 +38,6 @@ _UI_EXTERN void uiDarwinControlSetHuggingPriority(uiDarwinControl *, NSLayoutPri
#define uiDarwinControlDefaultDestroy(type, handlefield) \
static void type ## Destroy(uiControl *c) \
{ \
uiControlVerifyDestroy(c); \
[type(c)->handlefield release]; \
uiFreeControl(c); \
}

View File

@ -25,7 +25,6 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
#define uiUnixControlDefaultDestroy(type) \
static void type ## Destroy(uiControl *c) \
{ \
uiControlVerifyDestroy(c); \
/* TODO is this safe on floating refs? */ \
g_object_unref(type(c)->widget); \
uiFreeControl(c); \

View File

@ -41,7 +41,6 @@ _UI_EXTERN void uiWindowsControlAssignControlIDZOrder(uiWindowsControl *, LONG_P
#define uiWindowsControlDefaultDestroy(type) \
static void type ## Destroy(uiControl *c) \
{ \
uiControlVerifyDestroy(c); \
uiWindowsEnsureDestroyWindow(type(c)->hwnd); \
uiFreeControl(c); \
}

View File

@ -144,7 +144,6 @@ static void uiWindowDestroy(uiControl *c)
{
uiWindow *w = uiWindow(c);
// TODO make sure all ports have the necessary verifications
// first hide ourselves
ShowWindow(w->hwnd, SW_HIDE);
// now destroy the child