mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +00:00
Merge pull request #1414 from lightpanda-io/cheak_leak_before_free
Check for arena pool leak _before_ resetting page arena
This commit is contained in:
@@ -244,6 +244,14 @@ pub fn deinit(self: *Page) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn reset(self: *Page, comptime initializing: bool) !void {
|
fn reset(self: *Page, comptime initializing: bool) !void {
|
||||||
|
if (comptime IS_DEBUG) {
|
||||||
|
var it = self._arena_pool_leak_track.valueIterator();
|
||||||
|
while (it.next()) |value_ptr| {
|
||||||
|
log.err(.bug, "ArenaPool Leak", .{ .owner = value_ptr.* });
|
||||||
|
}
|
||||||
|
self._arena_pool_leak_track.clearRetainingCapacity();
|
||||||
|
}
|
||||||
|
|
||||||
if (comptime initializing == false) {
|
if (comptime initializing == false) {
|
||||||
// Removins the context triggers the linked inspector.
|
// Removins the context triggers the linked inspector.
|
||||||
// It seems to append a collect task to the message loop.
|
// It seems to append a collect task to the message loop.
|
||||||
@@ -326,14 +334,6 @@ fn reset(self: *Page, comptime initializing: bool) !void {
|
|||||||
self._undefined_custom_elements = .{};
|
self._undefined_custom_elements = .{};
|
||||||
|
|
||||||
try self.registerBackgroundTasks();
|
try self.registerBackgroundTasks();
|
||||||
|
|
||||||
if (comptime IS_DEBUG) {
|
|
||||||
var it = self._arena_pool_leak_track.valueIterator();
|
|
||||||
while (it.next()) |value_ptr| {
|
|
||||||
log.err(.bug, "ArenaPool Leak", .{ .owner = value_ptr.* });
|
|
||||||
}
|
|
||||||
self._arena_pool_leak_track.clearRetainingCapacity();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn base(self: *const Page) [:0]const u8 {
|
pub fn base(self: *const Page) [:0]const u8 {
|
||||||
|
|||||||
Reference in New Issue
Block a user