Change errdefers in create()/init() functions
They should use gpa.destroy() instead of foo.destroy() because (most) of them have fields that may not be initialized by the first error, so the foo.destroy() could crash.
This commit is contained in:
parent
2b336299eb
commit
6bf607b759
11 changed files with 12 additions and 11 deletions
|
|
@ -11,7 +11,7 @@ pub const Flag = struct {
|
|||
kind: enum { boolean, arg },
|
||||
};
|
||||
|
||||
pub fn parser(comptime Arg: type, comptime flags: []const Flag) type {
|
||||
pub fn Parser(comptime Arg: type, comptime flags: []const Flag) type {
|
||||
switch (Arg) {
|
||||
// TODO consider allowing []const u8
|
||||
[:0]const u8, [*:0]const u8 => {}, // ok
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue