[Github-comments] [geany/geany] Keep an invalid document in documents[0] (#247)

Nick Treleaven notifications at xxxxx
Mon Jul 22 12:01:39 UTC 2019


ntrel commented on this pull request.



> @@ -383,6 +381,10 @@ GeanyDocument *document_get_current(void)
 void document_init_doclist(void)
 {
 	documents_array = g_ptr_array_new();
+#ifdef GEANY_DEBUG
+	// add a dummy invalid document to catch naive iteration
+	g_ptr_array_add(documents_array, g_new0(GeanyDocument, 1));

Oh I see what you mean. I think it's better not to rely on that working just in case that function is changed later.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/247#discussion_r305807276
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190722/3843b8dc/attachment.html>


More information about the Github-comments mailing list