DestroyBody may trigger EndContact.
Py_XDECREF may cause userData to be released before DestroyBody.
Here we put the Py_XDECREF after DestroyBody. So in EndContact callback the userData should be valid.
It's still not 100% safe. Bad thing will happen if user code try to change userData in EndContact callback called from DestroyBody.
It should be safer than before though.
Coverage remained the same at 0.0% when pulling 9172d95becefb40ba835639bb85b3707e7e94532 on xzfn:fix_119 into f8617198555d2e1539b0be82f0ee6e7db4d26085 on pybox2d:master.
DestroyBody may trigger EndContact. Py_XDECREF may cause userData to be released before DestroyBody.
Here we put the Py_XDECREF after DestroyBody. So in EndContact callback the userData should be valid.
It's still not 100% safe. Bad thing will happen if user code try to change userData in EndContact callback called from DestroyBody. It should be safer than before though.