Created attachment 54 [details] diff -u patch against intercoms/src/G4UIcommandTree.cc G4UIcommandTree::RemoveCommand() incorrectly deletes "empty" directories because of an incorrect definition of "empty". The definition used in the distribution is "directory contains no commands"; the definition should also require "directory contains no sub-directories". Consider the following simple directory structure /a/b/c/D /a/b/e/F For clarity, lowercase letters denote directories, and capitalized letters denote "true" commands. In the 9.2.p02 distribution, if you delete the G4UIcommand associated with "D", G4UIcommandTree::RemoveCommand() will first delete "D" /a/b/c/ /a/b/e/F "c" is now empty, so lines 135-153 will remove it from the commandTree /a/b/ /a/b/e/F and next check "b". "b" still has "e" as a member, but "e" is not counted, as the test is only for "commands" not "trees", so /a/b/ is considered empty and removed, leaving /a/ which is clearly empty. Deleting "D" has immolated the entire hierarchy! Removal of hierarchies at run time is a useful behavior, so this bug, while pretty trivial, is really annoying. I have a number of volumes that can be added by the user through a G4UIcommand at runtime. These volumes have additional commands associated with them that I don't want to appear unless the volumes exist; similarly, I want the commands to go away if the volumes are removed. The attached patch corrects this problem without changing the interface; see also the referenced hypernews postings.
Thanks for your kind report. It will be fixed in the 9.3 release as you suggested.