Use std.mem.Allocator.dupe instead of @memcpy.

This commit is contained in:
andrew.kraevskii
2026-03-04 01:13:03 +03:00
parent 3348b2e91c
commit e3a4506194
4 changed files with 4 additions and 8 deletions

View File

@@ -676,8 +676,7 @@ fn drawPropertyEditor(canvas: *Canvas, obj: *Document.Object, prop: *const Prope
}
if (changed) {
const slice = canvas.allocator.alloc(Point2_f, list.items.len) catch return;
@memcpy(slice, list.items);
const slice = canvas.allocator.dupe(Point2_f, list.items) catch return;
obj.setProperty(canvas.allocator, .{ .data = .{ .points = slice } }) catch {
canvas.allocator.free(slice);
return;