fix various problems, thanks CppCheck :) (#1005)

* explained a bit more the core_window_letterbox example

* fixed a few 'ups' moments that could lead to mild head pain and time loss
This commit is contained in:
João Coelho
2019-10-29 14:57:19 +00:00
committed by Ray
parent 64c588e9d8
commit 75b0264f35
7 changed files with 37 additions and 10 deletions

View File

@@ -842,9 +842,17 @@ PHYSACDEF void DestroyPhysicsBody(PhysicsBody body)
}
}
#if defined(PHYSAC_DEBUG)
if (index == -1) printf("[PHYSAC] cannot find body id %i in pointers array\n", id);
#endif
if (index == -1){
#if defined(PHYSAC_DEBUG)
printf("[PHYSAC] cannot find body id %i in pointers array\n", id);
#endif
// prevent access to index -1
return;
}
// Free body allocated memory
PHYSAC_FREE(body);
@@ -1249,9 +1257,16 @@ static void DestroyPhysicsManifold(PhysicsManifold manifold)
}
}
#if defined(PHYSAC_DEBUG)
if (index == -1) printf("[PHYSAC] cannot find manifold id %i in pointers array\n", id);
#endif
if (index == -1) {
#if defined(PHYSAC_DEBUG)
printf("[PHYSAC] cannot find manifold id %i in pointers array\n", id);
#endif
//prevent access to index -1
return;
}
// Free manifold allocated memory
PHYSAC_FREE(manifold);