slembcke / Chipmunk2D

A fast and lightweight 2D game physics library.
http://chipmunk2d.net
MIT License
2.22k stars 352 forks source link

Crash in debug mode using MSVC 2022 #243

Open vinnyhorgan opened 11 months ago

vinnyhorgan commented 11 months ago

Hello,

I added chipmunk as a submodule in my project that uses cmake, I included it like this:

add_subdirectory(deps/chipmunk) include_directories(deps/chipmunk/include) target_link_libraries(${PROJECT_NAME} chipmunk_static)

I then copied the hello world example in the documentation and run the program:

In release mode everything works as expected, the problem is in debug mode where it crashed. Debugging the program shows that the crash happens when calling:

cpSpaceFree(space)

This seems very strange, but cannot figure it out, maybe I missed something in the cmake setup?

If anyone could try and reproduce this bug it would be amazing...

Thanks!

jacknicklenson commented 11 months ago

+1 yeah that's exactly happened to me.

This is just previous call stack of crash: image

This is crash point: image