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

[kstyle] Implement application unpolish to delete ShadowHelper

Summary:
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
crash.

CCBUG: 372001

Reviewers: #plasma, broulik, hpereiradacosta

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3240
parent 088c7672
......@@ -197,9 +197,24 @@ namespace Breeze
//______________________________________________________________
Style::~Style( void )
{
cleanup();
}
//______________________________________________________________
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
cleanup();
}
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
private:
//* 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