mirror of
https://github.com/godotengine/godot.git
synced 2025-01-18 20:40:57 +08:00
Remove unnecessary null pointer checks
This commit is contained in:
parent
cb39db0b02
commit
cabf923484
@ -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,7 +139,6 @@ void RtAudio :: getCompiledApi( std::vector<RtAudio::Api> &apis ) throw()
|
||||
|
||||
void RtAudio :: openRtApi( RtAudio::Api api )
|
||||
{
|
||||
if ( rtapi_ )
|
||||
delete rtapi_;
|
||||
rtapi_ = 0;
|
||||
|
||||
@ -216,7 +215,6 @@ RtAudio :: RtAudio( RtAudio::Api api )
|
||||
|
||||
RtAudio :: ~RtAudio() throw()
|
||||
{
|
||||
if ( rtapi_ )
|
||||
delete rtapi_;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,6 @@ void OS_Unix::finalize_core() {
|
||||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
|
||||
}
|
||||
|
@ -118,7 +118,6 @@ void AudioDriverMediaKit::unlock() {
|
||||
}
|
||||
|
||||
void AudioDriverMediaKit::finish() {
|
||||
if (player)
|
||||
delete player;
|
||||
|
||||
if (samples_in) {
|
||||
|
@ -16,9 +16,7 @@ HaikuDirectWindow::HaikuDirectWindow(BRect p_frame)
|
||||
|
||||
|
||||
HaikuDirectWindow::~HaikuDirectWindow() {
|
||||
if (update_runner) {
|
||||
delete update_runner;
|
||||
}
|
||||
}
|
||||
|
||||
void HaikuDirectWindow::SetHaikuGLView(HaikuGLView* p_view) {
|
||||
|
@ -144,7 +144,6 @@ void OSNacl::finalize_core() {
|
||||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
|
||||
};
|
||||
|
@ -1144,7 +1144,6 @@ void OS_Windows::finalize_core() {
|
||||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
|
||||
|
||||
|
@ -345,7 +345,6 @@ void OSWinrt::finalize_core() {
|
||||
|
||||
if (mempool_dynamic)
|
||||
memdelete( mempool_dynamic );
|
||||
if (mempool_static)
|
||||
delete mempool_static;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user