From 53d630c9c4813142ee13e6843c30476a5db26e78 Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 26 Jan 2007 20:22:50 +0000 Subject: Each file in this commit exhibit an example of what prevent calls 'reverse inull'. All that means is that a pointer gets dereferenced. Then a pointer gets checked for validity before being dereferenced again. This almost always points to shenanigans. For example, the konsole.cpp file has this konsoleInit() call which passes in a const char** shell variable. Since it is a double pointer the programmer who wrote the code made the mistake of mixing the checking of the pointer and the pointer that points to the pointer. This commit attempts to correct that. Of course there are other instances of the same thing. But they all boil down to a small mistake which might have produced strange side effects. --- (limited to 'noncore') diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp index 13f297e..61a47d7 100644 --- a/noncore/applets/notesapplet/notes.cpp +++ b/noncore/applets/notesapplet/notes.cpp @@ -235,7 +235,7 @@ void NotesControl::showMenu() { m->setFocus(); m->exec( QCursor::pos() ); - if(m) delete m; + delete m; } void NotesControl::focusOutEvent ( QFocusEvent * e) { diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 828f5a1..cf19ba8 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -496,7 +496,7 @@ void AdvancedFm::showFileMenu() { m->exec(QPoint(QCursor::pos().x(),QCursor::pos().y())); - if(m) delete m; + delete m; } -- cgit v0.9.0.2