If you feel like it you can see how she goes, but 40 is pretty high. I'd have her looked at.
We were heading to the doc for an ear infection with DD2 after temps over 39 the other night, but she came good & hasn't had a problem since! I'm still waiting for it to come back though...