Hey Michael,

2008/7/13 Michael Ivanov <[EMAIL PROTECTED]>:
> Hallo!
>
> A question about object ownership.
>
> WAbstractItemModel inherits from WObject. It is supplied a WObject as parent
> in a constructor, so that means WAbstractItemModel instance should be 
> destroyed
> when parent is destroyed, i.e. ownership for this object belongs to parent.

True.

> Now if I supply the model to WComboBox the first thing that 
> WComboBox::setModel
> unconditionally does is to delete it's current model. Manual says "The model 
> may
> not be 0, and ownership of the model is not transferred.", so I expected the
> model to continue to be valid even when it is replaced by another one in combo
> box (and got several obscure coredumps).

You expected the sensible thing, but ...

> So is it a bug or a feature? :-)

I know it is a rethorical question but part of the humiliation of
making bugs should be to admit them :-)

It was a bug. And it has been fixed in CVS.

Regards,
koen

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to