Skip to content

Commit

Permalink
removed unecssary null ptr checks + changed NULL to nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNotSoftware authored and paroj committed Jan 7, 2024
1 parent bdc6bd2 commit ee5fd3b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions RenderSystems/Direct3D11/include/OgreD3D11Prerequisites.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ THE SOFTWARE.
}

// some D3D commonly used macros
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
#define SAFE_DELETE(p) { (p)=nullptr; }
#define SAFE_DELETE_ARRAY(p) { (p)=nullptr; }
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=nullptr; } }

#if defined(_WIN32_WINNT_WIN8) // Win8 SDK required to compile, will work on Windows 8 and Platform Update for Windows 7
#define OGRE_D3D11_PROFILING 1
Expand Down
4 changes: 2 additions & 2 deletions Tools/LightwaveConverter/include/lwEnvelope.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class lwEnvelope
public:
lwEnvelope()
{
name = 0;
name = nullptr;
}

~lwEnvelope()
{
if (name) free(name);
delete[] name;
unsigned int i;
for (i=0; i<keys.size(); delete keys[i++]);
for (i=0; i<cfilters.size(); delete cfilters[i++]);
Expand Down
3 changes: 1 addition & 2 deletions Tools/MayaExport/include/materialSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ namespace OgreMayaExporter
//destructor
~MaterialSet(){
clear();
if (m_pDefaultMat)
delete m_pDefaultMat;
delete m_pDefaultMat;
}
//clear
void clear(){
Expand Down

0 comments on commit ee5fd3b

Please sign in to comment.