shell: Fix memory leak after changing wallpaper plugin

KConfigLoader doesn't have a parent, and will cause memory leak after
the wallpaper plugin is changed.
wilder-5.25
Fushan Wen 4 years ago
parent 2e056ed6e5
commit cef441e467
No known key found for this signature in database
GPG Key ID: 2E48D1487C91DCAA
  1. 4
      shell/containmentconfigview.cpp

@ -182,9 +182,9 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper)
cfg = KConfigGroup(&cfg, "Wallpaper");
cfg = KConfigGroup(&cfg, wallpaper);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_currentWallpaperConfig = m_ownWallpaperConfig = new KDeclarative::ConfigPropertyMap(new KConfigLoader(cfg, &file), this);
m_currentWallpaperConfig = m_ownWallpaperConfig = new KDeclarative::ConfigPropertyMap(new KConfigLoader(cfg, &file, this), this);
#else
m_currentWallpaperConfig = m_ownWallpaperConfig = new KConfigPropertyMap(new KConfigLoader(cfg, &file), this);
m_currentWallpaperConfig = m_ownWallpaperConfig = new KConfigPropertyMap(new KConfigLoader(cfg, &file, this), this);
#endif
}

Loading…
Cancel
Save