Method

MaplibreNativeFfiRenderSessionrelease_async

Declaration [src]

void
maplibre_native_ffi_render_session_release_async (
  MaplibreNativeFfiRenderSession* self,
  GAsyncReadyCallback callback,
  gpointer user_data
)

Description [src]

Releases the session, detaching it first when it is attached.

Pending frame demands finish with MAPLIBRE_NATIVE_FFI_RENDER_RESULT_TARGET_NOT_READY. 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 MAPLIBRE_NATIVE_FFI_RENDER_DRIVER_CALLER_GRAPHICS_THREAD detaches at your next maplibre_native_ffi_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 maplibre_native_ffi_render_session_abandon() does.

See mln_render_session_release in the C API reference.

It fails with these errors:

  • MAPLIBRE_NATIVE_FFI_ERROR_INVALID_STATE while you hold one of the session’s acquired frames. Release or discard them first.

This method completes asynchronously. Use maplibre_native_ffi_render_session_release_finish() inside the GAsyncReadyCallback to obtain the result of the operation.

Parameters

callback

Type: GAsyncReadyCallback

The callback to call when the release finishes.

The argument can be NULL.
user_data

Type: gpointer

The data to pass to callback.

The argument can be NULL.
The data is owned by the caller of the method.