"snapped a rifle from its locks"
A gun lock is a type of rack to hold rifles. It is called a “lock” because it includes a trigger guard that prevents the gun from firing while it is mounted on the rack.