RE: [libxml++] libxmlpp::DomParser not safe in lists by value - p robably not a v alue type



> From: andy glew amd com [mailto:andy glew amd com] 
>   		list<xmlpp::DomParser> lst;

I would not expect this to work. It shouldn't be possible.

> Now, I'm not sure whether this is intentional or not.
> But I cannot see any reason why it should be.
> And I come from the school that says, if you don't
> want something to be treated like a first class value object,
> then remove (make private) the copy constructor and assignment 
> methods.

Yes, could you give us a patch for that? Maybe you should look at the other
classes too.
 
> Code inspection reveals that DomParser has a _doc pointer
> member, which could be released twice after a copy.
> There's no reference counter or the like on the pointed
> to document, or it's _impl.

Reference-counting could be nice, for all classes, but I think that's a
bigger decision that might happen for the new unstable branch. (which I
personally plan to start as soon as glibmm 2.3.0 is released, which will
happen as soon as glib 2.3.0 is releeased.)

Thanks.

Murray Cumming
murrayc usa net
www.murrayc.com 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]