Le 25/06/2016 18:36, Guillaume Munch a écrit :

 > @@ -328,6 +329,7 @@ public:
 >           delete splitter_;
 >           delete bg_widget_;
 >           delete stack_widget_;
 > +        delete insets_;
 >       }

This is incorrect. The pointer is not owned by GuiView::GuiViewPrivate
but by Qt (by passing *this to the constructor of the object pointed to
by insets_).


Small correction: It is not owned by Qt from the start (the custom
constructor does not specify an owning widget). However, as explained in
the comment below, the GuiToolBar takes possession of the InsetCombo
later, when it is inserted in the toolbar. Yes, this is tricky and not
done like that usually.

Also, I should have written what is the correct version for clarity. Do
not delete it there.


 >/**
 > * \warning Don't Delete! The layout box is actually owned by
 > * whichever toolbar contains it. All the GuiView class needs is a
 > * means of accessing it.
 > *
 > * FIXME: replace that with a proper model so that we are not limited
 > * to only one dialog.
 > */


Reply via email to