<p><b>@b4n</b> requested changes on this pull request.</p>

<p>Great work investigating and fixing this!</p>
<p>I came to the same conclusion as you did trying to see how I'd fix that.<br>
Logic looks good to me, and I couldn't find a case of bad behavior when actually trying it <g-emoji class="g-emoji" alias="+1" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji></p>
<p>I'd just like a few small fixups and we should be good to go.</p><hr>

<p>In <a href="https://github.com/geany/geany/pull/1857#discussion_r238095416">src/document.c</a>:</p>
<pre style='color:#555'>> @@ -704,7 +704,7 @@ static gboolean remove_page(guint page_num)
 
        g_return_val_if_fail(doc != NULL, FALSE);
 
-       if (doc->changed && ! dialogs_show_unsaved_file(doc))
+       if (! main_status.closing_all && doc->changed && ! dialogs_show_unsaved_file(doc))
</pre>
<p>Please add a comment above, like <code>/* if we're closing all, document_account_for_unsaved() has been called already, no need to ask again. */</code></p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1857#discussion_r238095461">src/document.c</a>:</p>
<pre style='color:#555'>> @@ -3387,11 +3387,7 @@ gboolean document_account_for_unsaved(void)
                                return FALSE;
                }
        }
-       /* all documents should now be accounted for, so ignore any changes */
-       foreach_document (i)
-       {
-               documents[i]->changed = FALSE;
-       }
+
</pre>
<p>Now you removed this, maybe remove the comment stating that <em>If successful, this should always be followed up with a call to <code>document_close_all()</code></em> right above the function.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1857#discussion_r238095666">src/document.c</a>:</p>
<pre style='color:#555'>> @@ -3387,11 +3387,7 @@ gboolean document_account_for_unsaved(void)
                                return FALSE;
                }
        }
-       /* all documents should now be accounted for, so ignore any changes */
-       foreach_document (i)
-       {
-               documents[i]->changed = FALSE;
-       }
+
</pre>
<p>Variable <code>i</code> is now unused and should be removed.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1857#discussion_r238095678">src/document.c</a>:</p>
<pre style='color:#555'>> @@ -3400,14 +3396,6 @@ static void force_close_all(void)
 {
        guint i, len = documents_array->len;
</pre>
<p><code>len</code> is now unused and should be removed.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1857#discussion_r238096397">src/libmain.c</a>:</p>
<pre style='color:#555'>> @@ -1262,16 +1262,20 @@ static void queue_free(GQueue *queue)
 }
 
 
-static void do_main_quit(void)
+static gboolean do_main_quit(void)
 {
        geany_debug("Quitting...");
</pre>
<p>Could you move the debug info after <code>docuent_close_all()</code>?  now it'd be kind of confusing if the user aborted the quitting process.</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/pull/1857#pullrequestreview-180558213">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ3Ar7rAcRKgmpoNDDEVAbLHepsmDks5u08ejgaJpZM4T82nj">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJxEsP04QZKYWvQrdHtM536MIaLsiks5u08ejgaJpZM4T82nj.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n requested changes on #1857"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1857#pullrequestreview-180558213"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/1857#pullrequestreview-180558213",
"url": "https://github.com/geany/geany/pull/1857#pullrequestreview-180558213",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "@b4n requested changes on 1857",
"sections": [
{
"text": "Great work investigating and fixing this!\r\n\r\nI came to the same conclusion as you did trying to see how I'd fix that.\r\nLogic looks good to me, and I couldn't find a case of bad behavior when actually trying it :+1: \r\n\r\nI'd just like a few small fixups and we should be good to go.",
"activityTitle": "**Colomban Wendling**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@b4n",
"facts": [

]
}
],
"potentialAction": [
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/pull/1857#pullrequestreview-180558213"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 334719459\n}"
}
],
"themeColor": "26292E"
}
]</script>