[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Patch: Remove redundant checks

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Wed, 23 Dec 2009 18:26:31 +0100

On 23.12.2009 09:33, Dmitry wrote:
> Stefan wrote:
>>> Also in TortoiseProc/Revisio​nGraph/SearchPathTre​e.cpp I found
>>> some strange code pattern that I marked with a comment. I suggest
>>> it is reviewed - looks like a severe bug.
>> That code is actually correct.
> Then I don't get what is meant there. What I see is the following: if
> "firstChild" is a null pointer nothing happens, but if it is not a
> null pointer "delete firstChild" is done, "firstChild" is not changed
> and remains not-null, so the while-loop continues forever and each
> iteration starting with the second one performs "delete" on an
> already deleted pointer. Did I miss anything?

The 'delete firstChild' triggers the destructor of 'firstChild' which
takes care of the rest. Just step through that part of the code with the
debugger and you'll see.


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-12-23 18:26:45 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.