Added bin destruction OS parent checks.
This commit is contained in:
parent
dad19a6318
commit
40dee5a693
|
@ -16,6 +16,7 @@ void binDestroy(uiControl *c)
|
|||
struct bin *b = (struct bin *) c;
|
||||
|
||||
// TODO find a way to move the parented check here
|
||||
// we can't check for an OS parent here because what we're working with with bin isn't subviews but rather content views (at least I think... TODO)
|
||||
// don't chain up to base here; we need to destroy children ourselves first
|
||||
if (b->mainControl != NULL) {
|
||||
uiControlSetParent(b->mainControl, NULL);
|
||||
|
|
|
@ -17,8 +17,13 @@ struct bin {
|
|||
void binDestroy(uiControl *c)
|
||||
{
|
||||
struct bin *b = (struct bin *) c;
|
||||
GtkWidget *binWidget;
|
||||
|
||||
// TODO find a way to move the parented check here
|
||||
// ensure clean removal by making sure the bin has no OS parent
|
||||
binWidget = GTK_WIDGET(uiControlHandle(uiControl(b)));
|
||||
if (gtk_widget_get_parent(binWidget) != NULL)
|
||||
complain("attempt to destroy bin %p while it has an OS parent", b);
|
||||
// don't chain up to base here; we need to destroy children ourselves first
|
||||
if (b->mainControl != NULL) {
|
||||
uiControlSetParent(b->mainControl, NULL);
|
||||
|
|
|
@ -14,8 +14,13 @@ struct bin {
|
|||
void binDestroy(uiControl *c)
|
||||
{
|
||||
struct bin *b = (struct bin *) c;
|
||||
HWND hwnd;
|
||||
|
||||
// TODO find a way to move the parented check here
|
||||
// ensure clean removal by making sure the bin has no OS parent
|
||||
hwnd = (HWND) uiControlHandle(uiControl(b));
|
||||
if (GetAncestor(hwnd, GA_PARENT) != NULL)
|
||||
complain("attempt to destroy bin %p while it has an OS parent", b);
|
||||
// don't chain up to base here; we need to destroy children ourselves first
|
||||
if (b->mainControl != NULL) {
|
||||
uiControlSetParent(b->mainControl, NULL);
|
||||
|
|
Loading…
Reference in New Issue