Bug 432660 - QML application crashes when using Breeze style and KColorSchemeManager
Summary: QML application crashes when using Breeze style and KColorSchemeManager
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: general (show other bugs)
Version: 5.20.90
Platform: Other Linux
: VHI crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-02-08 18:41 UTC by george fb
Modified: 2021-02-10 07:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments
example app (1.65 KB, application/zip)
2021-02-08 18:41 UTC, george fb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description george fb 2021-02-08 18:41:14 UTC
Created attachment 135519 [details]
example app

SUMMARY
I have a QML application (https://github.com/g-fb/haruna) where I set QApplication::setStyle("Breeze") (because of this https://bugs.kde.org/show_bug.cgi?id=430667) and I also have an option to change the color scheme through KColorSchemeManager.
This worked well before 5.21 beta, but on 5.21 beta it crashes.


STEPS TO REPRODUCE
1. Download example app
2. Build
3. Run

OBSERVED RESULT
Application crashes when run

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210205
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.10.12-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 2600 Six-Core Processor
Memory: 15,6 GiB of RAM
Graphics Processor: GeForce GTX 750 Ti/PCIe/SSE2

ADDITIONAL INFORMATION
Example app backtrace
https://invent.kde.org/-/snippets/1493
Comment 1 Bug Janitor Service 2021-02-09 08:56:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/breeze/-/merge_requests/81
Comment 2 David Redondo 2021-02-09 15:52:34 UTC
Git commit 5de36bd1381b1d755c8f2dd4b95b9758d3225b14 by David Redondo.
Committed on 09/02/2021 at 10:53.
Pushed by davidre into branch 'master'.

Clean up listener

If the style is unloaded for example by an application dynamically
switching styles, the listener was still around leading us to call
into destroyed objects when the color scheme was changed.

M  +1    -1    kstyle/breezetoolsareamanager.cpp
M  +1    -0    kstyle/breezetoolsareamanager.h

https://invent.kde.org/plasma/breeze/commit/5de36bd1381b1d755c8f2dd4b95b9758d3225b14
Comment 3 David Redondo 2021-02-09 15:54:07 UTC
Git commit 12e42f014338cce6a6d706a222a2f4af4bbb49b2 by David Redondo.
Committed on 09/02/2021 at 15:54.
Pushed by davidre into branch 'Plasma/5.21'.

Clean up listener

If the style is unloaded for example by an application dynamically
switching styles, the listener was still around leading us to call
into destroyed objects when the color scheme was changed.


(cherry picked from commit 5de36bd1381b1d755c8f2dd4b95b9758d3225b14)

M  +1    -1    kstyle/breezetoolsareamanager.cpp
M  +1    -0    kstyle/breezetoolsareamanager.h

https://invent.kde.org/plasma/breeze/commit/12e42f014338cce6a6d706a222a2f4af4bbb49b2
Comment 4 Norbert Preining 2021-02-10 07:28:53 UTC
The same fix also helped with digikam 7.2.0-rc, where I saw crashes due to colorscheme switches, see https://bugs.kde.org/show_bug.cgi?id=432646