Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> Angus Leeming wrote:
> > So a summary of this patch might be: A BufferView requires a 
> > valid WorkArea, so make the code do that. (ATM, the code logic
> > is inverted.)

> No, you got it wrong, that's exactly the opposite I want to achieve: a 
> WorkArea needs a valid BufferView. I want the WorkArea to use the 
> BufferView and the Bufferview to not even know about the WorkArea existence.

Please think what you are trying to achieve when you post a patch. It takes only
a few minutes to provide an overview summary and may even mean that you get
meaningful comments ;-)

> IMHO, not in this case. The problem of shared_ptr is that you don't know 
> where they are reset. So I think it is wrong to pass shared_ptr around. 
> They are very useful and I use them in my Gui and GuiImplemtation. 
> Please find attached the header of these classes.

If LyXView "owns" a Foo* pointer (wrapped up as shared_ptr<Foo>) that means to
me tht only LyXView can delete the pointer. If that's the case, then you should
either provide a Foo& accessor for the case when a Foo& is always valid or
provide a weak_ptr<Foo> accessor for the case that sometimes the pointer is 
null.

That way, you document your usage semantics *in code*.

Angus

Reply via email to