You should not have to close and re-run mIRC at all in this situation. I change wifi networks all the time without issues.

However, if you have tried closing mIRC and running it again, and this still hasn't resolved the issue, this usually means that there is an issue with your Windows network configuration, anti-virus/firewall, router, and/or internet connection.