summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-24 22:11:11 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-24 22:11:11 +0200
commit5268fb9f7e1bca4b0fc496ff115c253aea724e49 (patch)
tree8023f45f3538f7966c2f75674a4b14fb4778e79c /src/gmdocument.c
parent9421f64ee86e6aec26e05a45bcfc65edd895a8a8 (diff)
Fixed threading issues and data races
The most serious problem was that GmRequest's response body was being accessed while the TlsRequest thread was modifying it. Now the response must always be locked before accessing elsewhere. There were also inefficient data updates in the media players.
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r--src/gmdocument.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index c8fc9869..50c79459 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -535,7 +535,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
535 } 535 }
536 /* Flag the end of line, too. */ 536 /* Flag the end of line, too. */
537 ((iGmRun *) back_Array(&d->layout))->flags |= endOfLine_GmRunFlag; 537 ((iGmRun *) back_Array(&d->layout))->flags |= endOfLine_GmRunFlag;
538 /* Image content. */ 538 /* Image or audio content. */
539 if (type == link_GmLineType) { 539 if (type == link_GmLineType) {
540 const iMediaId imageId = findLinkImage_Media(d->media, run.linkId); 540 const iMediaId imageId = findLinkImage_Media(d->media, run.linkId);
541 const iMediaId audioId = !imageId ? findLinkAudio_Media(d->media, run.linkId) : 0; 541 const iMediaId audioId = !imageId ? findLinkAudio_Media(d->media, run.linkId) : 0;