The safest way to do it is to take off the holster with the gun in it, and then put them both on together. Many ND's happen while disarming/arming in a vehicle outside a prohibited place, and with a Glock, you run a risk of the trigger catching on a piece of clothing while reholstering in the car.
I used to unload the gun before I left it in the car, so if it was stolen, it wasn't loaded, but more handling brings a higher risk of an ND.
If I have to leave it in the car, I remove the gun and holster together, then remove the mag (I have a mag safety that prevents the gun from firing without a mag inserted), and lock it in a lockbox in the console. I take all mags with me, so if it gets stolen, it's inoperable.