  We study the final distribution of the winding numbers in a 1D
superconducting ring that is quenched through its critical temperature in the
absence of magnetic flux. The study is conducted using the stochastic
time-dependent Ginzburg--Landau model, and the results are compared with the
Kibble--Zurek mechanism (KZM). The assumptions of KZM are formulated and
checked as three separate postulates. We find a characteristic length and
characteristic times for the processes we study. Besides the case of uniform
rings, we examined the case of rings with several weak links. For temperatures
close or below $T_c$, the coherence length does not characterize the
correlation length. In order to regard the winding number as a conserved
quantity, it is necessary to allow for a short lapse of time during which
unstable configurations decay. We found criteria for the validity of the 1D
treatment. The is no lower bound for final temperatures that permit 1D
treatment. For moderate quenching times $\tau_Q$, the variance of the winding
number obeys the scaling $< n^2>\propto \tau_Q^{-1/4}$, as predicted by KZM in
the case of mean field models; for $\tau_Q\alt 10^5\hbar /k_BT_c$, the
dependence is weaker. We also studied the behavior of the system when
fluctuations of the gauge field are suppressed, and obtained that the scaling
$< n^2>\propto \tau_Q^{-1/4}$ is obeyed over a wider range.
