private void AccumulateDestroyedHandles (Control c, ArrayList list)
{
DebugHelper.Enter ();
if (c != null) {
Control[] controls = c.Controls.GetAllControls ();
DebugHelper.WriteLine ("Checking control:0x{0:x}", c.IsHandleCreated ? c.Handle.ToInt32() : 0);
if (c.IsHandleCreated && !c.IsDisposed) {
Hwnd hwnd = Hwnd.ObjectFromHandle(c.Handle);
#if DriverDebug || DriverDebugDestroy
Console.WriteLine (" + adding {0} to the list of zombie windows", XplatUI.Window (hwnd.Handle));
Console.WriteLine (" + parent X window is {0:X}", XGetParent (hwnd.whole_window).ToInt32());
#endif
list.Add (hwnd);
CleanupCachedWindows (hwnd);
}
for (int i = 0; i < controls.Length; i ++) {
AccumulateDestroyedHandles (controls[i], list);
}
}
DebugHelper.Leave ();
}