logic continues to execute a little after bge.logic.endGame()

I am running a “always” sensor with pulse mode “on”. When I detect a certain conditional, I tell the game engine to stop by issuing bge.logic.endGame()

BGE stops, but 3-5 extra logic ticks still get executed before the actual close. What’s going on?

  1. What pulse frequency are you running the always sensor with?
  2. Running bge.logic.endGame() won’t end the game right when you run that function, but rather should happen by the end of that logic tick. Are you sure that those extra ticks are actually running, and aren’t just other objects firing the ‘last tick’ of their logic?