Remove unnecessary null pointer checks
This commit is contained in:
parent
cb39db0b02
commit
cabf923484
8 changed files with 10 additions and 19 deletions
|
@ -217,8 +217,8 @@ b2Polygon::b2Polygon(b2Triangle& t) {
|
|||
void b2Polygon::Set(const b2Polygon& p) {
|
||||
if (nVertices != p.nVertices){
|
||||
nVertices = p.nVertices;
|
||||
if (x) delete[] x;
|
||||
if (y) delete[] y;
|
||||
delete[] x;
|
||||
delete[] y;
|
||||
x = new float32[nVertices];
|
||||
y = new float32[nVertices];
|
||||
}
|
||||
|
|
|
@ -139,8 +139,7 @@ void RtAudio :: getCompiledApi( std::vector<RtAudio::Api> &apis ) throw()
|
|||
|
||||
void RtAudio :: openRtApi( RtAudio::Api api )
|
||||
{
|
||||
if ( rtapi_ )
|
||||
delete rtapi_;
|
||||
delete rtapi_;
|
||||
rtapi_ = 0;
|
||||
|
||||
#if defined(__UNIX_JACK__)
|
||||
|
@ -216,8 +215,7 @@ RtAudio :: RtAudio( RtAudio::Api api )
|
|||
|
||||
RtAudio :: ~RtAudio() throw()
|
||||
{
|
||||
if ( rtapi_ )
|
||||
delete rtapi_;
|
||||
delete rtapi_;
|
||||
}
|
||||
|
||||
void RtAudio :: openStream( RtAudio::StreamParameters *outputParameters,
|
||||
|
|
|
@ -149,8 +149,7 @@ void OS_Unix::finalize_core() {
|
|||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
delete mempool_static;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -118,8 +118,7 @@ void AudioDriverMediaKit::unlock() {
|
|||
}
|
||||
|
||||
void AudioDriverMediaKit::finish() {
|
||||
if (player)
|
||||
delete player;
|
||||
delete player;
|
||||
|
||||
if (samples_in) {
|
||||
memdelete_arr(samples_in);
|
||||
|
|
|
@ -16,9 +16,7 @@ HaikuDirectWindow::HaikuDirectWindow(BRect p_frame)
|
|||
|
||||
|
||||
HaikuDirectWindow::~HaikuDirectWindow() {
|
||||
if (update_runner) {
|
||||
delete update_runner;
|
||||
}
|
||||
delete update_runner;
|
||||
}
|
||||
|
||||
void HaikuDirectWindow::SetHaikuGLView(HaikuGLView* p_view) {
|
||||
|
|
|
@ -144,8 +144,7 @@ void OSNacl::finalize_core() {
|
|||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
delete mempool_static;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1144,8 +1144,7 @@ void OS_Windows::finalize_core() {
|
|||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
delete mempool_static;
|
||||
|
||||
|
||||
TCPServerWinsock::cleanup();
|
||||
|
|
|
@ -345,8 +345,7 @@ void OSWinrt::finalize_core() {
|
|||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
delete mempool_static;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue