Use std.mem.Allocator.dupe instead of @memcpy.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user