kwin: delete the already created plugin config widget from KWin::KWinDecorationModule::load()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-10-23 06:30:47 +03:00
parent 516b46e3ec
commit d70570e598

View file

@ -89,11 +89,14 @@ KWinDecorationModule::~KWinDecorationModule()
void KWinDecorationModule::load()
{
delete m_pluginConfigWidget;
m_pluginConfigWidget = nullptr;
KConfigGroup config(m_kwinConfig, "Style");
QLibrary library(styleToConfigLib(config));
if (library.load()) {
void *alloc_ptr = library.resolve("allocate_config");
if (alloc_ptr != NULL) {
if (alloc_ptr != nullptr) {
allocatePlugin = (QObject * (*)(KConfigGroup & conf, QWidget * parent))alloc_ptr;
m_pluginConfigWidget = new KVBox(this);
m_pluginObject = (QObject*)(allocatePlugin(config, m_pluginConfigWidget));