[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegames
From:       Laurent Montel <montel () kde ! org>
Date:       2011-04-26 13:54:21
Message-ID: 20110426135421.E6FE1AC866 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1229288 by mlaurent:

don't check pointer before to delete it


 M  +0 -8      libkdegames/kgame/dialogs/kgamedialogconfig.cpp  
 M  +0 -4      libkdegames/kgameprogress.cpp  
 M  +2 -2      lskat/src/mainwindow.cpp  


--- trunk/KDE/kdegames/libkdegames/kgame/dialogs/kgamedialogconfig.cpp #1229287:1229288
@@ -497,10 +497,8 @@
  }
  KGameDialogConfig::setAdmin(a);
  if (admin()) {
-	if (d->noAdmin) {
 		delete d->noAdmin;
 		d->noAdmin = 0;
-	}
 	d->changeMaxClients = new QPushButton(i18n("Change Maximal Number of Clients"), this);
 	connect(d->changeMaxClients, SIGNAL(pressed()), this, SLOT(slotChangeMaxClients()));
 	d->changeAdmin = new QPushButton(i18n("Change Admin"), this);
@@ -511,18 +509,12 @@
 	d->senderLayout->addWidget(d->changeAdmin);
 	d->senderLayout->addWidget(d->removeClient);
  } else {
-	if (d->changeMaxClients) {
 		delete d->changeMaxClients;
 		d->changeMaxClients = 0;
-	}
-	if (d->changeAdmin) {
 		delete d->changeAdmin;
 		d->changeAdmin = 0;
-	}
-	if (d->removeClient) {
 		delete d->removeClient;
 		d->removeClient = 0;
-	}
 	d->noAdmin = new QLabel(i18n("Only the admin can configure the message server!"), this);
 	d->senderLayout->addWidget(d->noAdmin);
  }
--- trunk/KDE/kdegames/libkdegames/kgameprogress.cpp #1229287:1229288
@@ -120,9 +120,7 @@
 {
 	if (pixmap.isNull())
 		return;
-	if (d->bar_pixmap)
 		delete d->bar_pixmap;
-
 	d->bar_pixmap = new QPixmap(pixmap);
 }
 
@@ -130,11 +128,9 @@
 {
 	d->bar_color = color;
 	d->use_supplied_bar_color = true;
-	if (d->bar_pixmap) {
 		delete d->bar_pixmap;
 		d->bar_pixmap = 0;
 	}
-}
 
 void KGameProgress::setBarStyle(BarStyle style)
 {
--- trunk/KDE/kdegames/lskat/src/mainwindow.cpp #1229287:1229288
@@ -604,8 +604,8 @@
     mGameMode = LSkat;
 
     // Start deleting
-    if (mDisplay) delete mDisplay;
-    if (mEngine) delete mEngine;
+    delete mDisplay;
+    delete mEngine;
 
     mDisplay = new DisplayTwo(mDeck, mCanvas, mTheme, ADVANCE_PERIOD, mView);
     mEngine = new EngineTwo(this, mDeck, (DisplayTwo*)mDisplay);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic