void OnResourceFound(CDavResourceNode* pNode)
in CDavWorkSession is a little misleading. If you are
going to pass a pointer to a method it should be
'newed' and the called method should take
responsibility to delete it.
The code that calls it is:
A better way to define it if you don't want new a
CDavResourceNode would be:
void OnResourceFound(CDavResourceNode& pNode)
This is very explicit in saying this object will go
away so make a copy of it or forget about it.
The way it is currently defined means "here's a
pointer, its your take care of it yourself"
On a side note, since it is entirly plausible the
programmer will have to cache the CDavResourceNode
after its found a simple copy constructor would be
helpfull. This would allow you to pass in a reference
to the CDavResourceNode and allow the programmer to
create a new CDavResourceNode and store it locally.
This could be accomplished by DOMNode the
CDavResourceNode was created with to create another copy.