Replace SAFE_DELETE / SAFE_DELETE_ARRAY macros

SAFE_DELETE -> RageUtil::SafeDelete
SAFE_DELETE_ARRAY -> RageUtil::SafeDeleteArray

Update JsonUtil.h to include RageUtil.h - MSVC doesn't need it included for some reason, but GCC and XCode does.
This commit is contained in:
sukibaby
2024-09-30 15:13:32 -07:00
committed by teejusb
parent cff063cd21
commit abf89ec2b1
62 changed files with 193 additions and 178 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ DialogDriver *MakeDialogDriver()
{
if( LOG )
LOG->Info( "Couldn't load driver %s: %s", asDriversToTry[i].c_str(), sError.c_str() );
SAFE_DELETE( pRet );
RageUtil::SafeDelete( pRet );
}
}
+1 -1
View File
@@ -40,7 +40,7 @@ DialogDriver *DialogDriver::Create()
return pRet;
if( LOG )
LOG->Info( "Couldn't load driver %s: %s", Driver.c_str(), sError.c_str() );
SAFE_DELETE( pRet );
RageUtil::SafeDelete( pRet );
}
return nullptr;
}
@@ -39,7 +39,7 @@ InputHandler_Win32_Para::InputHandler_Win32_Para()
{
LOG->Info("Para controller initialized");
}
SAFE_DELETE( dev );
RageUtil::SafeDelete( dev );
}
void InputHandler_Win32_Para::GetDevicesAndDescriptions(std::vector<InputDeviceInfo>& vDevicesOut )
@@ -35,7 +35,7 @@ namespace
{
out->Flush();
out->Close();
SAFE_DELETE(out);
RageUtil::SafeDelete(out);
}
}
@@ -102,7 +102,7 @@ inline RageFile * openOutputStream(const RString& filename)
if(!file->Open(filename, RageFile::WRITE|RageFile::STREAMED))
{
LOG->Warn("Error opening file '%s' for output: %s", filename.c_str(), file->GetError().c_str());
SAFE_DELETE(file);
RageUtil::SafeDelete(file);
file = nullptr;
}
+1 -1
View File
@@ -46,7 +46,7 @@ LoadingWindow *LoadingWindow::Create()
if( sError != "" )
{
LOG->Info( "Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str() );
SAFE_DELETE( ret );
RageUtil::SafeDelete( ret );
}
}
+1 -1
View File
@@ -124,7 +124,7 @@ RageMovieTexture *RageMovieTexture::Create( RageTextureID ID )
if( ret == nullptr )
{
LOG->Trace( "Couldn't load driver %s: %s", driverString, sError.c_str() );
SAFE_DELETE( ret );
RageUtil::SafeDelete( ret );
continue;
}
LOG->Trace( "Created movie texture \"%s\" with driver \"%s\"",
@@ -649,7 +649,7 @@ RageMovieTexture* RageMovieTextureDriver_FFMpeg::Create(RageTextureID ID, RStrin
MovieTexture_FFMpeg* pRet = new MovieTexture_FFMpeg(ID);
sError = pRet->Init();
if (!sError.empty())
SAFE_DELETE(pRet);
RageUtil::SafeDelete(pRet);
return pRet;
}
@@ -258,7 +258,7 @@ void MovieTexture_Generic::CreateTexture()
if( fmt != PixelFormatYCbCr_Invalid )
{
SAFE_DELETE( m_pTextureIntermediate );
RageUtil::SafeDelete( m_pTextureIntermediate );
m_pSprite->UnloadTexture();
/* Create the render target. This will receive the final, converted texture. */
+1 -1
View File
@@ -88,7 +88,7 @@ RageSoundDriver *RageSoundDriver::Create( const RString& drivers )
return pRet;
}
LOG->Info( "Couldn't load driver %s: %s", driverString, sError.c_str() );
SAFE_DELETE( pRet );
RageUtil::SafeDelete( pRet );
}
return nullptr;
}