Yep. Don't squeeze the trigger unless you want it to discharge in the general direction the muzzle is pointed.
Same rule applies with any other gun, it seems to me.
That said I must admit a Glock would be a poor choice for a pocket gun. Especially if you were drunk.
Anyone who carries a pistol or revolver in their pocket
without a pocket holster is asking for trouble.