Removed uiControlVerifyDestroy(); we could have just had it in uiFreeControl().
This commit is contained in:
parent
1c2acf59a3
commit
1d8ea79e45
|
@ -12,7 +12,10 @@ This README is being written.<br>
|
||||||
|
|
||||||
## Updates
|
## 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
|
## Runtime Requirements
|
||||||
|
|
||||||
|
|
|
@ -71,14 +71,10 @@ uiControl *uiAllocControl(size_t size, uint32_t OSsig, uint32_t typesig, const c
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiFreeControl(uiControl *c)
|
void uiFreeControl(uiControl *c)
|
||||||
{
|
|
||||||
uiFree(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void uiControlVerifyDestroy(uiControl *c)
|
|
||||||
{
|
{
|
||||||
if (uiControlParent(c) != NULL)
|
if (uiControlParent(c) != NULL)
|
||||||
userbug("You cannot destroy a uiControl while it still has a parent. (control: %p)", c);
|
userbug("You cannot destroy a uiControl while it still has a parent. (control: %p)", c);
|
||||||
|
uiFree(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiControlVerifySetParent(uiControl *c, uiControl *parent)
|
void uiControlVerifySetParent(uiControl *c, uiControl *parent)
|
||||||
|
|
1
ui.h
1
ui.h
|
@ -77,7 +77,6 @@ _UI_EXTERN uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig,
|
||||||
_UI_EXTERN void uiFreeControl(uiControl *);
|
_UI_EXTERN void uiFreeControl(uiControl *);
|
||||||
|
|
||||||
// TODO make sure all controls have these
|
// TODO make sure all controls have these
|
||||||
_UI_EXTERN void uiControlVerifyDestroy(uiControl *);
|
|
||||||
_UI_EXTERN void uiControlVerifySetParent(uiControl *, uiControl *);
|
_UI_EXTERN void uiControlVerifySetParent(uiControl *, uiControl *);
|
||||||
_UI_EXTERN int uiControlEnabledToUser(uiControl *);
|
_UI_EXTERN int uiControlEnabledToUser(uiControl *);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ _UI_EXTERN void uiDarwinControlSetHuggingPriority(uiDarwinControl *, NSLayoutPri
|
||||||
#define uiDarwinControlDefaultDestroy(type, handlefield) \
|
#define uiDarwinControlDefaultDestroy(type, handlefield) \
|
||||||
static void type ## Destroy(uiControl *c) \
|
static void type ## Destroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
uiControlVerifyDestroy(c); \
|
|
||||||
[type(c)->handlefield release]; \
|
[type(c)->handlefield release]; \
|
||||||
uiFreeControl(c); \
|
uiFreeControl(c); \
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
|
||||||
#define uiUnixControlDefaultDestroy(type) \
|
#define uiUnixControlDefaultDestroy(type) \
|
||||||
static void type ## Destroy(uiControl *c) \
|
static void type ## Destroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
uiControlVerifyDestroy(c); \
|
|
||||||
/* TODO is this safe on floating refs? */ \
|
/* TODO is this safe on floating refs? */ \
|
||||||
g_object_unref(type(c)->widget); \
|
g_object_unref(type(c)->widget); \
|
||||||
uiFreeControl(c); \
|
uiFreeControl(c); \
|
||||||
|
|
|
@ -41,7 +41,6 @@ _UI_EXTERN void uiWindowsControlAssignControlIDZOrder(uiWindowsControl *, LONG_P
|
||||||
#define uiWindowsControlDefaultDestroy(type) \
|
#define uiWindowsControlDefaultDestroy(type) \
|
||||||
static void type ## Destroy(uiControl *c) \
|
static void type ## Destroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
uiControlVerifyDestroy(c); \
|
|
||||||
uiWindowsEnsureDestroyWindow(type(c)->hwnd); \
|
uiWindowsEnsureDestroyWindow(type(c)->hwnd); \
|
||||||
uiFreeControl(c); \
|
uiFreeControl(c); \
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,6 @@ static void uiWindowDestroy(uiControl *c)
|
||||||
{
|
{
|
||||||
uiWindow *w = uiWindow(c);
|
uiWindow *w = uiWindow(c);
|
||||||
|
|
||||||
// TODO make sure all ports have the necessary verifications
|
|
||||||
// first hide ourselves
|
// first hide ourselves
|
||||||
ShowWindow(w->hwnd, SW_HIDE);
|
ShowWindow(w->hwnd, SW_HIDE);
|
||||||
// now destroy the child
|
// now destroy the child
|
||||||
|
|
Loading…
Reference in New Issue