From: Taylor R Campbell Date: Wed, 29 May 2019 20:47:46 +0000 (+0000) Subject: Hold strong reference to message header while writing summary line. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=42190e37acb92921fa97c9364454a322152ce56d;p=mit-scheme.git 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. (cherry picked from commit e4efa02c98e06c00a3541f56a1e5dce94c45e925) --- 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))