Commit a0433d08 authored by Martin Flöser's avatar Martin Flöser

[kstyle] Implement application unpolish to delete ShadowHelper

Another change mostly for KWin (Wayland compositor). KWin destroys it's
internal Wayland connection prior to the QStyle getting destroyed. As
the ShadowHelper initialized Wayland objects those would be destroyed
after the connection is destroyed. With latest Wayland library this
would cause a crash.

Thus unpolish is implemented in the style and deletes the ShadowHelper.
KWin can on tear down invoke the unpolish and thus make sure it doesn't

CCBUG: 372001

Reviewers: #plasma, broulik, hpereiradacosta

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 088c7672
......@@ -197,9 +197,24 @@ namespace Breeze
Style::~Style( void )
void Style::unpolish( QApplication* )
// NOTE: unpolish is not called in general on tear-down of Application
// only when a new QStyle is loaded by the QApplication unpolish is invoked
void Style::cleanup( void )
delete _shadowHelper;
_shadowHelper = nullptr;
delete _helper;
_helper = nullptr;
......@@ -92,7 +92,6 @@ namespace Breeze
//* needed to avoid warnings at compilation time
using ParentStyleClass::polish;
using ParentStyleClass::unpolish;
//* widget polishing
virtual void polish( QWidget* );
......@@ -100,6 +99,9 @@ namespace Breeze
//* widget unpolishing
virtual void unpolish( QWidget* );
//* application unpolishing
void unpolish( QApplication* ) override;
//* polish scrollarea
void polishScrollArea( QAbstractScrollArea* );
......@@ -471,6 +473,9 @@ namespace Breeze
//* shared cleanup for unpolish and dtor
void cleanup();
//*@name scrollbar button types (for addLine and subLine )
ScrollBarButtonType _addLineButtons;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment