D29542: Refactor MainWindow view

2020-05-11 Thread Dag Andersen
danders added a comment.


  Hmmm, it seems to me you are creating a leak in your lines 544, 545? (Have 
not tested, I might be wrong)
  
  Afaics the problem is that a focus event is issued that accesses the view 
after death.
  Possibly a deleteLater() would do it, but I tried with setting paret to 
nullptr:
  
while(!oldRootViews.isEmpty()) {
KoView *v = oldRootViews.takeFirst();
v->setParent(nullptr);
delete v;
}
  
  (Also in KoMainWindow dtor to be consistent.)

REPOSITORY
  R8 Calligra

REVISION DETAIL
  https://phabricator.kde.org/D29542

To: anthonyfieroni, boemann, danders, #calligra:_3.0
Cc: Calligra-Devel-list, davidllewellynjones, dcaliste, ognarb, cochise, 
vandenoever


D29542: Refactor MainWindow view

2020-05-11 Thread Anthony Fieroni
anthonyfieroni added a comment.


  `d->rootPart->createView(doc, this);` Creates the view which parent is main 
window.

REPOSITORY
  R8 Calligra

REVISION DETAIL
  https://phabricator.kde.org/D29542

To: anthonyfieroni, boemann, danders, #calligra:_3.0
Cc: Calligra-Devel-list, davidllewellynjones, dcaliste, ognarb, cochise, 
vandenoever


D29542: Refactor MainWindow view

2020-05-11 Thread Dag Andersen
danders added a comment.


  In D29542#668076 , @anthonyfieroni 
wrote:
  
  >   `d->rootPart->createView(doc, this);` Creates the view which parent is 
main window.
  
  
  Ahh, yes, but then...
  Why will it not crash if a new document is set so that d->rootView != 0 ?

REPOSITORY
  R8 Calligra

REVISION DETAIL
  https://phabricator.kde.org/D29542

To: anthonyfieroni, boemann, danders, #calligra:_3.0
Cc: Calligra-Devel-list, davidllewellynjones, dcaliste, ognarb, cochise, 
vandenoever


D29542: Refactor MainWindow view

2020-05-11 Thread Anthony Fieroni
anthonyfieroni added a comment.


  We should call `removeEventFilter` or found exactly why signal is emitted in 
destructor.

REPOSITORY
  R8 Calligra

REVISION DETAIL
  https://phabricator.kde.org/D29542

To: anthonyfieroni, boemann, danders, #calligra:_3.0
Cc: Calligra-Devel-list, davidllewellynjones, dcaliste, ognarb, cochise, 
vandenoever