changeset 2370:bbf8a522dcec

removing non-nullptr conditions before deletes
author Grumpy7
date Mon, 12 May 2014 01:55:23 +0200
parents bddcaf5d5db2
children 7bf6901add4a bcd7fadbf7d2 e07e297f292d
files Game.cpp Render.cpp VideoPlayer.cpp mm7_3.cpp stru6.cpp stru6.h
diffstat 6 files changed, 23 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/Game.cpp	Mon May 12 01:50:32 2014 +0200
+++ b/Game.cpp	Mon May 12 01:55:23 2014 +0200
@@ -785,8 +785,7 @@
 //----- (00465CF3) --------------------------------------------------------
 void Game::Destroy()
 {
-  if (pGame)
-    delete pGame;
+  delete pGame;
   pGame = nullptr;
 }
 
--- a/Render.cpp	Mon May 12 01:50:32 2014 +0200
+++ b/Render.cpp	Mon May 12 01:55:23 2014 +0200
@@ -759,8 +759,7 @@
   {
     delete [] v20.pDriverName;
     delete [] v20.pDeviceDesc;
-    if ( v20.pGUID )
-      delete v20.pGUID;
+    delete v20.pGUID;
   }
   else
   {
@@ -768,8 +767,7 @@
     {
       delete [] v20.pDriverName;
       delete [] v20.pDeviceDesc;
-      if ( v20.pGUID )
-        delete v20.pGUID;
+      delete v20.pGUID;
       v6 = (IUnknown *)pDirectDraw;
     }
     else
--- a/VideoPlayer.cpp	Mon May 12 01:50:32 2014 +0200
+++ b/VideoPlayer.cpp	Mon May 12 01:55:23 2014 +0200
@@ -254,11 +254,8 @@
     AIL_redbook_resume(pAudioPlayer->hAILRedbook);
   pEventTimer->Resume();
 
-  if (pMovie)
-  {
-	  delete pMovie;
-	  pMovie = nullptr;
-  }
+	delete pMovie;
+	pMovie = nullptr;
 }
 
 void VideoPlayer::_inlined_in_463149()
--- a/mm7_3.cpp	Mon May 12 01:50:32 2014 +0200
+++ b/mm7_3.cpp	Mon May 12 01:55:23 2014 +0200
@@ -2272,7 +2272,7 @@
   if (!skybox_xp || xp_width != xn_width || xp_height != xn_height)
   {
     delete [] skybox_xn;
-    if (skybox_xp) delete [] skybox_xp;
+    delete [] skybox_xp;
     return false;
   }
 
@@ -2281,8 +2281,8 @@
   if (!skybox_yn || yn_width != xn_width || yn_height != xn_height)
   {
     delete [] skybox_xn;
-    if (skybox_xp) delete [] skybox_xp;
-    if (skybox_yn) delete [] skybox_yn;
+    delete [] skybox_xp;
+    delete [] skybox_yn;
     return false;
   }
 
@@ -2291,9 +2291,9 @@
   if (!skybox_yp || yp_width != xn_width || yp_height != xn_height)
   {
     delete [] skybox_xn;
-    if (skybox_xp) delete [] skybox_xp;
-    if (skybox_yn) delete [] skybox_yn;
-    if (skybox_yp) delete [] skybox_yp;
+    delete [] skybox_xp;
+    delete [] skybox_yn;
+    delete [] skybox_yp;
     return false;
   }
 
@@ -2302,10 +2302,10 @@
   if (!skybox_zn || zn_width != xn_width || zn_height != xn_height)
   {
     delete [] skybox_xn;
-    if (skybox_xp) delete [] skybox_xp;
-    if (skybox_yn) delete [] skybox_yn;
-    if (skybox_yp) delete [] skybox_yp;
-    if (skybox_zn) delete [] skybox_zn;
+    delete [] skybox_xp;
+    delete [] skybox_yn;
+    delete [] skybox_yp;
+    delete [] skybox_zn;
     return false;
   }
 
@@ -2314,11 +2314,11 @@
   if (!skybox_zp || zp_width != xn_width || zp_height != xn_height)
   {
     delete [] skybox_xn;
-    if (skybox_xp) delete [] skybox_xp;
-    if (skybox_yn) delete [] skybox_yn;
-    if (skybox_yp) delete [] skybox_yp;
-    if (skybox_zn) delete [] skybox_zn;
-    if (skybox_zp) delete [] skybox_zp;
+    delete [] skybox_xp;
+    delete [] skybox_yn;
+    delete [] skybox_yp;
+    delete [] skybox_zn;
+    delete [] skybox_zp;
     return false;
   }
 
--- a/stru6.cpp	Mon May 12 01:50:32 2014 +0200
+++ b/stru6.cpp	Mon May 12 01:55:23 2014 +0200
@@ -129,12 +129,10 @@
 //----- (004775C4) --------------------------------------------------------
 stru6_stru1_indoor_sw_billboard::~stru6_stru1_indoor_sw_billboard()
 {
-    if (pArray1)
-        delete [] pArray1;
+    delete [] pArray1;
     pArray1 = nullptr;
 
-    if (pArray2)
-        delete [] pArray2;
+    delete [] pArray2;
     pArray2 = nullptr;
 }
 
--- a/stru6.h	Mon May 12 01:50:32 2014 +0200
+++ b/stru6.h	Mon May 12 01:55:23 2014 +0200
@@ -112,8 +112,7 @@
   //----- (004A71DC) --------------------------------------------------------
   ~stru6()
   {
-    if (pStru1)
-      delete pStru1;
+    delete pStru1;
     pStru1 = nullptr;
   }