release method
Releases the session, detaching it first when it is attached.
Pending frame demands finish with RenderResult.targetNotReady. Once the
release completes, the library no longer uses your graphics objects, and
you can attach another session to the map.
A session driven by RenderDriverKind.callerGraphicsThread detaches at
your next mln_render_session_service_driver_work(), so keep servicing it
until the release completes. When the session isn't attached, such as
while it attaches or after it fails, or when you release or dispose its
map before that service, the release abandons it as
RenderSessionHandle.abandon() does.
See mln_render_session_release in the
C API reference.
Errors:
Status.invalidStatewhile you hold one of the session's acquired frames. Release or discard them first.
Implementation
Future<void> release() => _state.closeAsync(
(handle) => _submit(
(arena, completion) => raw.mln_render_session_release(
handle.raw,
completion,
nativeDiagnostic,
),
),
);