From 1d8ea79e4593a4fdf25bc0ebabf22609ddab51c6 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 22 May 2016 01:07:25 -0400 Subject: [PATCH] Removed uiControlVerifyDestroy(); we could have just had it in uiFreeControl(). --- README.md | 5 ++++- common/control.c | 6 +----- ui.h | 1 - ui_darwin.h | 1 - ui_unix.h | 1 - ui_windows.h | 1 - windows/window.cpp | 1 - 7 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7a1bd319..374eae61 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ This README is being written.
## 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 diff --git a/common/control.c b/common/control.c index 64da9e03..28066461 100644 --- a/common/control.c +++ b/common/control.c @@ -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) diff --git a/ui.h b/ui.h index 3968f01c..2302b7b4 100644 --- a/ui.h +++ b/ui.h @@ -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 *); diff --git a/ui_darwin.h b/ui_darwin.h index fde55b42..387e6829 100644 --- a/ui_darwin.h +++ b/ui_darwin.h @@ -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); \ } diff --git a/ui_unix.h b/ui_unix.h index 6ea475a6..f8cdf3dd 100644 --- a/ui_unix.h +++ b/ui_unix.h @@ -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); \ diff --git a/ui_windows.h b/ui_windows.h index b1a6362f..81185f51 100644 --- a/ui_windows.h +++ b/ui_windows.h @@ -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); \ } diff --git a/windows/window.cpp b/windows/window.cpp index 100008d8..f9806c72 100644 --- a/windows/window.cpp +++ b/windows/window.cpp @@ -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