The window or door locking has a locking bolt, which is retractable in a duct mounted on the sashes, in order to lock the sashes. The locking bolt is movable axially between a locking position to unsecure a releasing position and a locking position securing by a safety mechanism. The locking bolt is placed away in the secured locking position over the unsecured locking position based on the releasing position by an axial actuation.