acquire reference on document font

This commit is contained in:
Karl Seguin
2026-04-14 22:53:03 +08:00
parent 2cdaac780b
commit 2087aa7aac
2 changed files with 7 additions and 1 deletions

View File

@@ -385,7 +385,12 @@ pub fn deinit(self: *Page, abort_http: bool) void {
observer.releaseRef(session);
}
self.window._document._selection.releaseRef(session);
var document = self.window._document;
document._selection.releaseRef(session);
if (document._fonts) |f| {
f.releaseRef(session);
}
}
session.browser.env.destroyContext(self.js);

View File

@@ -454,6 +454,7 @@ pub fn getFonts(self: *Document, page: *Page) !*FontFaceSet {
return fonts;
}
const fonts = try FontFaceSet.init(page);
fonts.acquireRef();
self._fonts = fonts;
return fonts;
}