mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
fix CI: store list pointer on AbstractRange to avoid Page type mismatch
The bridge.finalizer resolves Page through its own module graph, which can differ from Range.zig's import in release builds. Store a pointer to the live_ranges list directly on AbstractRange so deinit can remove without accessing Page fields.
This commit is contained in:
@@ -282,6 +282,7 @@ pub fn abstractRange(self: *Factory, child: anytype, page: *Page) !*@TypeOf(chil
|
||||
._start_container = doc,
|
||||
};
|
||||
chain.setLeaf(1, child);
|
||||
abstract_range._live_ranges = &page._live_ranges;
|
||||
page._live_ranges.append(&abstract_range._range_link);
|
||||
return chain.get(1);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ _start_container: *Node,
|
||||
|
||||
// Intrusive linked list node for tracking live ranges on the Page.
|
||||
_range_link: std.DoublyLinkedList.Node = .{},
|
||||
_live_ranges: *std.DoublyLinkedList = undefined,
|
||||
|
||||
pub const Type = union(enum) {
|
||||
range: *Range,
|
||||
|
||||
@@ -680,8 +680,8 @@ fn getContainerElement(self: *const Range) ?*Node.Element {
|
||||
return parent.is(Node.Element);
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Range, _: bool, page: *Page) void {
|
||||
page._live_ranges.remove(&self._proto._range_link);
|
||||
pub fn deinit(self: *Range, _: bool, _: *Page) void {
|
||||
self._proto._live_ranges.remove(&self._proto._range_link);
|
||||
}
|
||||
|
||||
pub const JsApi = struct {
|
||||
|
||||
Reference in New Issue
Block a user