Message: PATCH: Deleting a sub-G4UIdirectory deletes the entire hierarchy Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More PATCH: Deleting a sub-G4UIdirectory deletes the entire hierarchy 

Forum: (Graphical) User Interfaces
Re: Question Deleting a sub-G4UIdirectory deletes the entire hierarchy (Kevin Lynch)
Date: 29 Oct, 2009
From: Kevin Lynch <Kevin Lynch>

Well, I got annoyed enough at this issue that I beat my head on it today, and I think I've tracked down the problem. I traced lots of code, and got myself deep into G4UIcommandTree::RemoveCommand(). The bug that causes my problem occurs when you delete a directory "command" in the commandTree; this deletes a sub tree, and the code recurses all the way back up the tree to the root, deleting all subtrees that are empty. But the test for emptiness in the release is wrong - it only looks to see if a directory has zero "real" commands in it .... directories that only had sub directories in them (such as "/gMIGTRACE/" in my application) are considered empty, and are wiped out of the commandTree. The root ("/") is spared because it is a special instance that never gets looked at, so it isn't getting obliterated.

The fix turned out to be easy; consider a directory empty only if it's REALLY empty. I've attached a patch against the 4.9.2.p02 release for inclusion in future releases. Hopefully, someone in the Geant4 collaboration will vet this for correctness and add it to the code base.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/10/29/18.10-70136-G4UIcommandTree.patch.txt

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 More: Re: PATCH: Deleting a sub-G4UIdirectory deletes the entire hierarchy   (Kevin Lynch - 29 Oct, 2009)
 Add Message Add Message
to: "PATCH: Deleting a sub-G4UIdirectory deletes the entire hierarchy"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]