The present invention is related to a top-loading washing and/or drying machine comprising: a cabinet (C); a drum (10) rotatably mounted within the cabinet (C) about a horizontal axis and having an aperture (12) on its cylindrical side; at least a drum door (14a, 14b) supported by the drum (10) for opening and closing the aperture (12); a safety mechanism (22) supported by the drum (10) and/or by the door (14a, 14b) and configured to selectively lock and unlock the door (14a, 14b). A sensing device is configured to sense a relative position of the door (14a, 14b) with respect to the safety mechanism (22). The sensing device is operatively connected to a control unit to provide a signal indicating a correct closed configuration of the door (14a, 14b).