Clicking on the [Close all windows] button invokes the close_all function which returns with a zero value which closes the child window, AAA.
But, unbeknown to the child, it now returns a zero value to its parent, courtesy of flag being set to zero by close_all. Horrified, entire family now disappear into the Big Bit Bin in the Sky!
No wonder we learn to distrust our offspring 😄
The elegance of the algorithm rather mitigates its gruesomeness 😄 Thank you for making the effort to respond, Wilfried. It is much appreciated 😄