On Fri, 21 Dec 2012 09:08:21 +1300, Rene Gollent <anevilyak@xxxxxxxxx> wrote:
On Dec 20, 2012 2:58 PM, "Clemens" <clemens.zeidler@xxxxxxxxx> wrote:no, there is only one reference in the calling code and _RegisterCommandcreates a CommandEntry holding a ref.deleting all CommandEntry s would delete the objectAgain, no. Each entry does get one, yes, but _RegisterCommand takes overthe initial one passed in (see its first lines) to ensure the command getscleaned up in case creating the entry fails. Rene
ok I see why it was done in the first place: if (_RegisterCommand("bt", stackTraceCommandReference.Detach()) && _RegisterCommand("continue", new(std::nothrow) CliContinueCommand) && _RegisterCommand("frame", new(std::nothrow) CliStackFrameCommand)matter of taste, I would say, would pass a reference here as well, just a more consistent use of refs...
cheers, Clemens