Yes you have to manually push the slide lock up to keep the slide back if there is no magazine in the pistol.
If there is an unloaded magazine in the pistol the slide will not go forward, if for some reason you want to close the slide with an empty magazine in the pistol, eject the magazine, close slide, reinsert magazine. You only have to let the magazine go down a tiny bit to be able to close it, you do not have to eject the magazine all the way from the pistol.
If there is a loaded magazine in the pistol and you hit the slide release (or pull the slide back and release, which personally I think is preferable) then the slide will go forward stripping the top round out of the magazine and loading it into the chamber, resulting a pistol which will, of course, fire,