<p>Found by inspection, needs to be checked.</p>

<p>Both the plain C file IO and GIO (g_file_replace_contents) can leave the original file damaged if a failure occurs during a write.  The normal advice is to "don't panic, you still have the buffer contents to save somewhere else", but if the save fails during a close Geany will still close, so now both the original file and the buffer are lost.</p>

<p>Basically <code>libmain.c</code> in <code>main_quit</code> should not ignore the return from <code>document_close_all()</code>.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1147">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJw1nhM81dZvHcIcuIIzHIHS2WTZLks5qYh-bgaJpZM4JTXT-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ300Oa3aEu0mgttayIHto0ox4wHIks5qYh-bgaJpZM4JTXT-.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1147"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>