# [Tex/LaTex] File ended while scanning use of \@writefile

compiling

My problem is that if I try to recompile a text after correction of some mistake, e.g. missing "}", the I get a message

Runaway argument?
{\contentsline {figure}{\numberline {\relax 3.9}{\ignorespaces
! File ended while scanning use of \@writefile.

\par
l.128 \begin{document}

Then I delete the *.aux file and other auxiliary files and so I can recompile without any problem. Howewer if again I get a mistake, compile the text,get an error message, stop compiling, fix an error in the text and try to recompile, again I will get the same "File ended while scanning use of \@writefile." and again the only one way is to delete the auxiliary files. Any suggestions how to fix the problem?

\caption{Scheme of GI off-specular scattering kinematics.