From e4efa02c98e06c00a3541f56a1e5dce94c45e925 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 29 May 2019 20:47:46 +0000 Subject: [PATCH] Hold strong reference to message header while writing summary line. This way the GC won't be inclined to eat it from under us when we're just going to parse it again in a moment for the date or subject. --- src/imail/imail-summary.scm | 44 +++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/imail/imail-summary.scm b/src/imail/imail-summary.scm index d79c57ed0..c7c5aea5e 100644 --- a/src/imail/imail-summary.scm +++ b/src/imail/imail-summary.scm @@ -512,27 +512,29 @@ SUBJECT is a string of regexps separated by commas." (buffer-not-modified! buffer)))))) (define (write-imail-summary-line! message index-digits mark) - (insert-char #\space mark) - (insert-string (message-flag-markers message) mark) - (insert-char #\space mark) - (insert-message-index (+ (message-index message) 1) index-digits mark) - (insert-string " " mark) - (insert-string (message-summary-length-string message) mark) - (if (ref-variable imail-summary-show-date mark) - (begin - (insert-string " " mark) - (insert-string (message-summary-date-string message) mark))) - (insert-string " " mark) - (let ((target-column - (fix:+ (mark-column mark) (imail-summary-subject-width mark)))) - (insert-string (message-summary-subject-string message) mark) - (if (fix:> (mark-column mark) target-column) - (delete-string (move-to-column mark target-column) mark)) - (if (fix:< (mark-column mark) target-column) - (insert-chars #\space (fix:- target-column (mark-column mark)) mark))) - (insert-string " " mark) - (insert-string (message-summary-from-string message) mark) - (insert-newline mark)) + (let ((header (message-header-fields message))) + (insert-char #\space mark) + (insert-string (message-flag-markers message) mark) + (insert-char #\space mark) + (insert-message-index (+ (message-index message) 1) index-digits mark) + (insert-string " " mark) + (insert-string (message-summary-length-string message) mark) + (if (ref-variable imail-summary-show-date mark) + (begin + (insert-string " " mark) + (insert-string (message-summary-date-string message) mark))) + (insert-string " " mark) + (let ((target-column + (fix:+ (mark-column mark) (imail-summary-subject-width mark)))) + (insert-string (message-summary-subject-string message) mark) + (if (fix:> (mark-column mark) target-column) + (delete-string (move-to-column mark target-column) mark)) + (if (fix:< (mark-column mark) target-column) + (insert-chars #\space (fix:- target-column (mark-column mark)) mark))) + (insert-string " " mark) + (insert-string (message-summary-from-string message) mark) + (insert-newline mark) + (reference-barrier header))) (define (insert-message-index index index-digits mark) (insert-string-pad-left (number->string index) index-digits #\space mark)) -- 2.25.1