summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-03 21:36:26 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-03 21:36:26 +0200
commitcf67675efc8d9cd75c4c52f653d61472065f683b (patch)
treefc77eb071ec9631653c16803859387ebaebc4795 /src/ui/documentwidget.c
parent450fe7eaf328788ad3c3b46d5536e8e1f1dfc50a (diff)
DocumentWidget: Fixed potential crash
Must clear all previous references to GmRuns when the document is updated.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index e87b1413..423dee6d 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -659,11 +659,12 @@ static void setSource_DocumentWidget_(iDocumentWidget *d, const iString *source)
659 setUrl_GmDocument(d->doc, d->mod.url); 659 setUrl_GmDocument(d->doc, d->mod.url);
660 setSource_GmDocument( 660 setSource_GmDocument(
661 d->doc, source, documentWidth_DocumentWidget_(d), forceBreakWidth_DocumentWidget_(d)); 661 d->doc, source, documentWidth_DocumentWidget_(d), forceBreakWidth_DocumentWidget_(d));
662 d->foundMark = iNullRange; 662 d->foundMark = iNullRange;
663 d->selectMark = iNullRange; 663 d->selectMark = iNullRange;
664 d->hoverLink = NULL; 664 d->hoverLink = NULL;
665 d->contextLink = NULL; 665 d->contextLink = NULL;
666 d->lastVisibleRun = NULL; 666 d->firstVisibleRun = NULL;
667 d->lastVisibleRun = NULL;
667 setValue_Anim(&d->outlineOpacity, 0.0f, 0); 668 setValue_Anim(&d->outlineOpacity, 0.0f, 0);
668 updateWindowTitle_DocumentWidget_(d); 669 updateWindowTitle_DocumentWidget_(d);
669 updateVisible_DocumentWidget_(d); 670 updateVisible_DocumentWidget_(d);