diff --git a/gb.gtk/src/CContainer.cpp b/gb.gtk/src/CContainer.cpp index 13dfbae24..253ddaee7 100644 --- a/gb.gtk/src/CContainer.cpp +++ b/gb.gtk/src/CContainer.cpp @@ -117,11 +117,16 @@ END_PROPERTY BEGIN_METHOD_VOID(ContainerChildren_Clear) gContainer *cont = WIDGET->proxyContainer(); - int i; + gControl *child; + + for(;;) + { + child = cont->child(0); + if (!child) + break; + child->destroy(); + } - for (i = 0; i < cont->childCount(); i++) - cont->child(i)->destroy(); - END_METHOD