Abstract: A locking device on two bodies movable in a sliding manner relative to each other on a sliding track has a locking pin (7) which is guided in a straight-line mechanism in the guide body transversely with respect to the sliding track and is movable in the expelling direction. A socket spanner is guided in a sliding manner parallel to the sliding direction in the guide body. The locking pin (7) projects with an actuating end into a pocket of the socket spanner. The pocket has edges and surfaces for expelling and inserting the locking bolt and for blocking the straight-line mechanism. The locking device is suitable in particular for the connection and aligning movement of two guide bodies as occur in particular in a point operating mechanism.