From e15b8145b11637535c54da31f9084ea7f905eba8 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Thu, 19 Feb 2026 10:50:12 +0100 Subject: [PATCH] create Animation in the pool arena --- src/browser/webapi/animation/Animation.zig | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/browser/webapi/animation/Animation.zig b/src/browser/webapi/animation/Animation.zig index 4daaa8d5..0ebe396b 100644 --- a/src/browser/webapi/animation/Animation.zig +++ b/src/browser/webapi/animation/Animation.zig @@ -52,14 +52,19 @@ pub fn init(page: *Page) !*Animation { const arena = try page.getArena(.{ .debug = "Animation" }); errdefer page.releaseArena(arena); - const self = try page._factory.create(Animation{ + const self = try arena.create(Animation); + self.* = .{ ._page = page, ._arena = arena, - }); + }; return self; } +pub fn deinit(self: *Animation, _: bool) void { + self._page.releaseArena(self._arena); +} + pub fn play(self: *Animation, page: *Page) !void { if (self._playState == .running) { return; @@ -164,10 +169,6 @@ pub fn getOnFinish(self: *const Animation) ?js.Function.Temp { return self._onFinish; } -pub fn deinit(self: *Animation, _: bool) void { - self._page.releaseArena(self._arena); -} - // callback function transitionning from a state to another fn update(ctx: *anyopaque) !?u32 { const self: *Animation = @ptrCast(@alignCast(ctx));