From a593ff930fc9690bcf9f0e51eb83f47d6c653150 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 23 Mar 2021 20:36:46 +0200 Subject: [PATCH] flag: add a .free() method --- vlib/flag/flag.v | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vlib/flag/flag.v b/vlib/flag/flag.v index 0dbfb496ed..a2cda98dfe 100644 --- a/vlib/flag/flag.v +++ b/vlib/flag/flag.v @@ -38,6 +38,18 @@ pub mut: args_description string } +[unsafe] +fn (mut f FlagParser) free() { + unsafe { + f.args.free() + f.flags.free() + f.application_name.free() + f.application_version.free() + f.application_description.free() + f.args_description.free() + } +} + pub const ( // used for formating usage message space = ' '