plug a bunch of memory leaks

svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=672687
This commit is contained in:
Aaron J. Seigo 2007-06-07 20:57:18 +00:00
parent e90845573e
commit 58277a7608
6 changed files with 26 additions and 14 deletions

View File

@ -56,6 +56,15 @@ public:
engineExplorerAction(0)
{
}
~Private()
{
delete layout;
while (!applets.isEmpty()) {
delete applets.takeFirst();
}
}
bool immutable;
Applet::List applets;
FormFactor formFactor;
@ -112,9 +121,7 @@ void Corona::init()
Corona::~Corona()
{
while (!d->applets.isEmpty()) {
delete d->applets.takeFirst();
}
delete d;
}
Location Corona::location() const

View File

@ -39,25 +39,29 @@ class DataEngineManager::Private
{
public:
Private()
: null(0)
: nullEng(0)
{}
~Private()
{
delete null;
foreach (Plasma::DataEngine* engine, m_engines) {
delete engine;
}
m_engines.clear();
delete nullEng;
}
DataEngine* nullEngine()
{
if (!null) {
null = new NullEngine;
if (!nullEng) {
nullEng = new NullEngine;
}
return null;
return nullEng;
}
DataEngine::Dict m_engines;
DataEngine* null;
DataEngine* nullEng;
};
class DataEngineManagerSingleton
@ -80,10 +84,7 @@ DataEngineManager::DataEngineManager()
DataEngineManager::~DataEngineManager()
{
foreach (Plasma::DataEngine* engine, d->m_engines) {
delete engine;
}
d->m_engines.clear();
delete d;
}
Plasma::DataEngine* DataEngineManager::dataEngine(const QString& name) const

View File

@ -191,7 +191,7 @@ Svg::Svg(const QString& imagePath, QObject* parent)
Svg::~Svg()
{
delete d;
}
void Svg::paint(QPainter* painter, const QPointF& point, const QString& elementID)

View File

@ -60,6 +60,7 @@ Theme::Theme(QObject* parent)
Theme::~Theme()
{
delete d;
}
QString Theme::themeName() const

View File

@ -37,6 +37,7 @@ LineEdit::LineEdit(QGraphicsItem *parent, QGraphicsScene *scene)
LineEdit::~LineEdit()
{
delete d;
}
void LineEdit::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)

View File

@ -47,6 +47,8 @@ VBoxLayout::~VBoxLayout()
foreach (LayoutItem *l, d->childList) {
l->resetLayout();
}
delete d;
}
Qt::Orientations VBoxLayout::expandingDirections() const