abandon method

RenderAbandonResult abandon()

Stops the session right away, without running its pending graphics work.

Use it when the target's graphics objects are going away and a detach can't finish first. Pending work completes with Status.targetLost, and pending frame demands finish with RenderResult.targetNotReady. Once the call returns, the library no longer uses your graphics objects, and you can attach another session to the map. Release the session afterward.

Abandon keeps the session's OpenGL and WebGPU objects until the process exits, and reports how many it kept. Detach the session instead to free them.

See mln_render_session_abandon in the C API reference.

Implementation

RenderAbandonResult abandon() => withNativeArena((arena) {
  final outResult = arena<raw.mln_render_abandon_result>();
  outResult.ref.size = sizeOf<raw.mln_render_abandon_result>();
  _check(
    raw.mln_render_session_abandon(_handle.raw, outResult, nativeDiagnostic),
  );
  return _readRenderAbandonResult(outResult.ref);
});