kdeui: plug some memory leaks

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-05-18 15:55:57 +00:00
parent 90ce55bb9f
commit ae98b867a0
2 changed files with 17 additions and 11 deletions

View file

@ -41,16 +41,6 @@
#include <X11/extensions/Xfixes.h>
#endif
class KWindowSystemStaticContainer {
public:
KWindowSystemStaticContainer() : d(0) {}
KWindowSystem kwm;
KWindowSystemPrivate* d;
};
K_GLOBAL_STATIC(KWindowSystemStaticContainer, g_kwmInstanceContainer)
static Atom net_wm_cm;
static void create_atoms( Display* dpy = QX11Info::display() );
@ -114,6 +104,17 @@ public:
bool removeStrutWindow( WId );
};
class KWindowSystemStaticContainer {
public:
KWindowSystemStaticContainer() : d(0) {}
~KWindowSystemStaticContainer() { if (d) d->deleteLater(); }
KWindowSystem kwm;
KWindowSystemPrivate* d;
};
K_GLOBAL_STATIC(KWindowSystemStaticContainer, g_kwmInstanceContainer)
KWindowSystemPrivate::KWindowSystemPrivate(int _what)
: QWidget(0),
NETRootInfo( QX11Info::display(),

View file

@ -51,6 +51,12 @@ public:
}
~KXMLGUIClientPrivate()
{
if (m_actionCollection) {
m_actionCollection->deleteLater();
}
if (m_builder) {
delete m_builder;
}
}
bool mergeXML( QDomElement &base, QDomElement &additive,
@ -108,7 +114,6 @@ KXMLGUIClient::~KXMLGUIClient()
client->d->m_parent = 0;
}
delete d->m_actionCollection;
delete d;
}