Not like "freeze" i mean like dangerous for the game glitchy.
As long as the game itself doesn't get hit, you're good!
I do the same thing and nothing hapened, so no, the game doesn`t glitch, even though on the battle subway my Pokemon Black freezes, but its rare for me, so it should be for you. :)