Skip to content

Move destroyInstance to Base level #167

@vkensou

Description

@vkensou

Suggestion move destroyInstance to Base level, move destroyDevice to Instance level

const instance_handle = try vkb.createInstance(&create_info, null);
// If load Instance proc failed, no chance to destroy instance
const vki = try proc.loadInstance(instance_handle, vkb.dispatch.vkGetInstanceProcAddr);
errdefer vki.destroyInstance(instance_handle, null);

destroyDevice is the same

const device_handle = try self.vki.createDevice(self.physical_devices[0], &p_create_info, null);
// If load Device proc failed, no chance to destroy device
const vkd = try proc.loadDevice(device_handle, vki.dispatch.vkGetDeviceProcAddr);
errdefer vkd.destroyDevice(device_handle, null);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions