DoxigAlpha

closeAndFree

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.

Function parameters

Parameters

#
self:*Directory

Functions in this namespace

Functions

#
closeAndFree
Whether or not the handle should be closed, or the path should be freed

Source

Implementation

#
pub fn closeAndFree(self: *Directory, gpa: Allocator) void {
    self.handle.close();
    if (self.path) |p| gpa.free(p);
    self.* = undefined;
}