> | Second point. 
> | LyXFunc contains:
> |     LyXView * owner;
> | 
> | LyXView contains:
> |     LyXFunc * lyxfunc;
> | 
> | isn't this a bit recursive! Is this related to the First
> | point?
> 
> No, not really. LyXFunc just has a pointer to the LyXView that owns
> it. Nothing strange about that.

Ok. Fair enough. Thanks.

New point:

The LyXView is controlled by LyXGUI. It
makes a new LyXView, but never deletes it. 

Can you modify LyXGUI::~LyXGUI()?
LyXGUI::~LyXGUI()
{
        ...
        if( lyxViews ) delete lyxViews;
}

The constructor should be modified too:

LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
        : _owner(owner), lyxViews(0)
{                                     ^^^^^^^^^^
        ...
}

This of course is aside from the fact that LyXGUI contains
a publiclly accessible pointer to the LyXView. Am I
allowed to say "Ughhh!"? What's wrong with:

class LyXGUI {
public:
        LyXView const & lyxview() const { return *lyxViews; }
private:
        LyXView *lyxViews;
}

Shall I make a patch for this?
Angus

Reply via email to