CCBUG: 421083
It looks like there is no need to have list of root views (since it has only one) it should be deleted when there is a new central widget.
boemann | |
danders |
Calligra: 3.0 |
CCBUG: 421083
It looks like there is no need to have list of root views (since it has only one) it should be deleted when there is a new central widget.
No crash any more.
Lint Skipped |
Unit Tests Skipped |
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.)
Ahh, yes, but then...
Why will it not crash if a new document is set so that d->rootView != 0 ?
We should call removeEventFilter or found exactly why signal is emitted in destructor.
@danders i saw your patch on my email. d->viewportWidget->canvas()->removeEventFilter(this); fixes the issue but i still prefer all of refactoring code. Please test on all components does not have regressions.
This seems to work fine, I also tested with only pageapp/flake changes.
Imho I would prefer to separate the pageapp/flake and KoMainWindow changes into separate commits,
The pageapp/flake changes should go into 3.2 branch followed by a swift release.
I don't think the KoMainWindow changes should go into the branch as it only removes unused functionallity.
I'm a bit in two minds if it should go in at all actually, so I'll leave it you or maybe somebody else has an opinion.
Seems fine, i'll push pageapp/flake changes as part of this review in 3.2 branch and master, refactoring main window in separate commit master only.
Incidentally, while this was committed before i could test it, i can confirm that it works fine with Calligra Gemini