ui: fix text display plan caching bug

This commit is contained in:
nakst 2022-03-02 21:08:11 +00:00
parent 10a7d4f1d1
commit 68649f9260
2 changed files with 6 additions and 5 deletions

View File

@ -4038,6 +4038,11 @@ EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags, EsStyleID st
// TODO Inline backgrounds.
void TextDisplayFreeRuns(EsTextDisplay *display) {
if (display->plan) {
EsTextPlanDestroy(display->plan);
display->plan = nullptr;
}
if (display->usingSyntaxHighlighting) {
Array<EsTextRun> textRuns = { display->textRuns };
textRuns.Free();
@ -4097,10 +4102,6 @@ int ProcessTextDisplayMessage(EsElement *element, EsMessage *message) {
display->measurementCache.Store(message);
}
} else if (message->type == ES_MSG_DESTROY) {
if (display->plan) {
EsTextPlanDestroy(display->plan);
}
TextDisplayFreeRuns(display);
EsHeapFree(display->contents);
} else if (message->type == ES_MSG_GET_INSPECTOR_INFORMATION) {

View File

@ -113,7 +113,7 @@ void GenerateAPISamples() {
if section == "[build]" && StringStartsWith(line, "source=") config[i] = "source=" + sourceFile;
}
FileWriteAll(folder + "make.build_core", StringJoin(config, "\n", false));
assert FileWriteAll(folder + "make.build_core", StringJoin(config, "\n", false));
}
}
}