diff options
author | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
commit | eed0eb6a476d54ce19aeff137984aa981d9e3976 (patch) | |
tree | 807891636efd2f87dcbd261e971216269973ae07 /iup/src/iup_object.c | |
parent | ccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff) |
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/iup_object.c')
-rwxr-xr-x | iup/src/iup_object.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/iup/src/iup_object.c b/iup/src/iup_object.c index 7f4ce23..f0d5dc9 100755 --- a/iup/src/iup_object.c +++ b/iup/src/iup_object.c @@ -148,6 +148,8 @@ Ihandle* IupCreate(const char *name) void IupDestroy(Ihandle *ih) { + Icallback cb; + iupASSERT(iupObjectCheck(ih)); if (!iupObjectCheck(ih)) return; @@ -156,6 +158,9 @@ void IupDestroy(Ihandle *ih) if (ih->iclass->nativetype == IUP_TYPEDIALOG) IupHide(ih); + cb = IupGetCallback(ih, "DESTROY_CB"); + if (cb) cb(ih); + /* Destroy all its children. Just need to remove the first child, IupDetach will update firstchild. */ @@ -165,6 +170,9 @@ void IupDestroy(Ihandle *ih) /* unmap if mapped and remove from its parent child list */ IupDetach(ih); + /* removes names associated with the element */ + iupRemoveNames(ih); + /* destroy the element */ iupClassObjectDestroy(ih); @@ -172,9 +180,6 @@ void IupDestroy(Ihandle *ih) if (ih->data) free(ih->data); - /* removes all the names associated with the element */ - iupRemoveAllNames(ih); - /* destroy the base handle structure */ iHandleDestroy(ih); } |