perf: release CSS rule map after warm open (#2439)

Co-authored-by: Erica Jensen <erica@mailershaven.com>
This commit is contained in:
hooligan333
2026-07-11 22:59:31 -04:00
committed by GitHub
co-authored by Erica Jensen
parent b596f21e61
commit d8139e9605
+5
View File
@@ -351,6 +351,11 @@ bool Epub::load(const bool buildIfMissing, const bool skipLoadingCss) {
Storage.removeDir((cachePath + "/sections").c_str());
}
}
// Release the resolved CSS rule map: it is only needed transiently while building
// section caches, and createSectionFile reloads it from cache on demand. Holding it
// resident pins tens of KB for the whole reading session (more on warm resume into
// an already-cached chapter, where createSectionFile never runs to clear it).
cssParser->clear();
LOG_DBG("EBP", "Loaded ePub: %s", filepath.c_str());
return true;
}