box2d with ofxtriangle exc_bad_access

Try work box2d with ofxtriangle, opencv and kinect, program work but some times there are error exc_bad_access code=2 address=0x0 triangle_impl.hpp in stroke detleft = (pa[0] - pc[0]) * (pb[1] - pc[1]);. But when i type std::cout << detleft << std::endl; every thing is okey. How can i fix that?