Home

xrDestroyInstance

xrDestroyInstance is a function in the OpenXR API used to terminate an OpenXR instance and release all resources associated with it. It is typically called when an application has finished using the runtime and no further OpenXR calls are needed.

Signature: XrResult xrDestroyInstance(XrInstance instance). The function takes the instance handle and destroys it, invalidating the handle

Return values: On success, XR_SUCCESS is returned. If the instance handle is invalid or has already been

Notes: The destroy operation is the finalization step for the instance; developers should ensure that any necessary

See also: xrCreateInstance. The function is typically used during application shutdown or when the OpenXR runtime

and
freeing
resources
such
as
sessions,
spaces,
action
sets,
and
other
runtime
objects
created
from
that
instance.
After
a
successful
call,
the
instance
handle
must
not
be
used
in
any
subsequent
OpenXR
calls.
destroyed,
XR_ERROR_HANDLE_INVALID
or
XR_ERROR_VALIDATION_FAILURE
may
be
returned
depending
on
the
situation.
The
runtime
may
also
return
XR_ERROR_RUNTIME_FAILURE
if
it
encounters
an
internal
error
during
teardown.
cleanup
of
higher-level
resources
is
performed
as
appropriate.
In
many
implementations,
destroying
the
instance
will
release
all
resources
associated
with
it
and
invalidate
related
handles.
is
no
longer
needed.