Function closeAndFree [src]
Whether or not the handle should be closed, or the path should be freed
is determined by usage, however this function is provided for convenience
if it happens to be what the caller needs.
Prototype
pub fn closeAndFree(self: *Directory, gpa: Allocator) void
Parameters
self: *Directory
gpa: Allocator
Source
pub fn closeAndFree(self: *Directory, gpa: Allocator) void {
self.handle.close();
if (self.path) |p| gpa.free(p);
self.* = undefined;
}