Doubtful it's a virus.
Make sure your Mac's software is up to date.
Open the App Store then select Updates from the menu.
Also, if you are using Safari to surf the net, you could have a Safari extension or third party plug-in installed that's causing this glitch.
Help here > If Safari is slow, stops responding, quits unexpectedly, or has other issues - Apple Support