Don't check pointer before to delete it

This commit is contained in:
Montel Laurent 2011-04-26 14:23:27 +02:00
parent 09fb933d2b
commit 17ae9c2510
4 changed files with 5 additions and 9 deletions

View file

@ -104,8 +104,7 @@ KfindDlg::~KfindDlg()
{
stopSearch();
if (dirwatch)
delete dirwatch;
delete dirwatch;
}
void KfindDlg::finishAndClose()
@ -142,8 +141,7 @@ void KfindDlg::startSearch()
enableButton(User2, true); // Enable "Stop"
enableButton(User1, false); // Disable "Save As..."
if(dirwatch!=NULL)
delete dirwatch;
delete dirwatch;
dirwatch=new KDirWatch();
connect(dirwatch, SIGNAL(created(const QString&)), this, SLOT(slotNewItems(const QString&)));
connect(dirwatch, SIGNAL(deleted(const QString&)), this, SLOT(slotDeleteItem(const QString&)));

View file

@ -44,7 +44,7 @@ ScanManager::ScanManager(const QString& path)
ScanManager::~ScanManager()
{
stopScan();
if (_topDir) delete _topDir;
delete _topDir;
}
void ScanManager::setListener(ScanListener* l)

View file

@ -211,7 +211,7 @@ DrawParams* RectDrawing::drawParams()
void RectDrawing::setDrawParams(DrawParams* dp)
{
if (_dp) delete _dp;
delete _dp;
_dp = dp;
}

View file

@ -33,9 +33,7 @@ OpenSearchEngine::OpenSearchEngine(QObject *)
OpenSearchEngine::~OpenSearchEngine()
{
if (m_scriptEngine) {
delete m_scriptEngine;
}
delete m_scriptEngine;
}
QString OpenSearchEngine::parseTemplate(const QString &searchTerm, const QString &searchTemplate)