The Glock has no hammer outside like 1911 variant so basically to release the hammer inside it, you will need to take out the magazines and fire it safe direction. That's safety procedure that we should for do for pistols before storage.
By the way, I'm assume that it's airsoft since GBB need magazine to fire the round. It's not like real steel that bullet can fire by it own.
__________________
|