Arbitrarily long quantum computations require quantum memories that can be repeatedly measured without being corrupted. Here, we preserve the state of a quantum memory, notably with the additional use of flagged error events. All error events were extracted using fast, midcircuit measurements and resets of the physical qubits. Among the error decoders we considered, we introduce a perfect matching decoder that was calibrated from measurements containing up to size-four correlated events. To compare the decoders, we used a partial postselection scheme shown to retain ten times more data than full postselection. We observed logical errors per round of 2.2±0.1×10-2 (decoded without postselection) and 5.1±0.7×10-4 (full postselection), which was less than the physical measurement error of 7×10-3 and therefore surpasses a pseudothreshold for repeated logical measurements.