Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes on destruction #242

Closed
tsdgeos opened this issue May 25, 2021 · 8 comments
Closed

Crashes on destruction #242

tsdgeos opened this issue May 25, 2021 · 8 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@tsdgeos
Copy link

tsdgeos commented May 25, 2021

  • Run spectacle
  • Close spectacle
  • Crash

There is too much deleting of widgets and layouts going on, in particular the issue seems to be in FontPicker but there's too many deletes everywhere. In Qt you don't need to delete widgets or layouts to which you have given a parent, the destructor will take care of deleting them, you can delete them manually but you have to be careful of not double deleting, i.e if you delete mLayout, that will already delete mButtonLayout because it is it's child mLayout->addLayout(mButtonLayout) so when you do later delete mButtonLayout again it crashes because you have already deleted it.

My suggestion would be to not do manual deleting of QWidgets and just left the parent/child relationship cleanup everything.

@DamirPorobic DamirPorobic added this to To do in v0.5.1 via automation May 26, 2021
@DamirPorobic DamirPorobic added the bug Something isn't working label May 26, 2021
@DamirPorobic DamirPorobic self-assigned this May 26, 2021
@DamirPorobic DamirPorobic moved this from To do to In progress in v0.5.1 May 26, 2021
@DamirPorobic
Copy link
Member

Thanks for reporting, I'll have a look.

@thrimbor
Copy link

I have a backtrace from the Spectacle crash, in case that helps:
spectacle-20210529-174329.kcrash.txt

@DamirPorobic
Copy link
Member

Thanks, I'll have a look into this issue tomorrow.

@eiglow
Copy link

eiglow commented May 30, 2021

Downstream bug report: https://bugs.kde.org/show_bug.cgi?id=437674

@DamirPorobic DamirPorobic changed the title 0.5.0 Crashes on destruction Crashes on destruction May 30, 2021
DamirPorobic added a commit that referenced this issue May 30, 2021
@DamirPorobic
Copy link
Member

I have removed deletes of widgets and layouts where a parent was provided on construction. Would be nice if someone could test.

@thrimbor
Copy link

That does seem to have fixed it, Spectacle no longer crashes when closing.

@DamirPorobic
Copy link
Member

Awesome, version is tagged now.

v0.5.1 automation moved this from In progress to Done May 31, 2021
@dflogeras
Copy link
Contributor

I also confirm the spectacle segfault is gone, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

5 participants