Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for issue 407. Reverted a previous bad fix. Also ran Visual Studi…
…o static analysis and fixed a couple things.
- Loading branch information
Showing
4 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ | |
imgui.ini | ||
**/xcshareddata | ||
*.ini | ||
*.lastcodeanalysissucceeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,6 +213,11 @@ b2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density) | |
|
||
void b2Body::DestroyFixture(b2Fixture* fixture) | ||
{ | ||
if (fixture == nullptr) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dagostinelli
|
||
{ | ||
return; | ||
} | ||
|
||
b2Assert(m_world->IsLocked() == false); | ||
if (m_world->IsLocked() == true) | ||
{ | ||
|
@@ -266,9 +271,9 @@ void b2Body::DestroyFixture(b2Fixture* fixture) | |
fixture->DestroyProxies(broadPhase); | ||
} | ||
|
||
fixture->Destroy(allocator); | ||
fixture->m_body = NULL; | ||
fixture->m_next = NULL; | ||
fixture->Destroy(allocator); | ||
fixture->~b2Fixture(); | ||
allocator->Free(fixture, sizeof(b2Fixture)); | ||
|
||
|
I prefer the style of
if (!fixture)
(overif (fixture == 0-indicator)
). Then there's no dependency on the0-indicator
having to be defined as expected either.