lynx_value_add_reference

Introduction

Increment the reference count by 1 for pointer data.

Syntax

lynx_api_status lynx_value_add_reference(
    lynx_api_env env, lynx_value value, lynx_value_ref* result);

Parameters

KeyDescription
[in] envThe environment in which lynx value runs, typically nullptr.
[in] valuelynx_value to be added ref.
[out] resultpreserve fields.

Return Value

Returns lynx_api_ok if the API succeeded.

Example

lynx_value val;
lynx_api_status status = lynx_value_create_array(env, &val);
if (status != lynx_api_ok) {
  // handle error.
}
// do something.
lynx_api_status status = lynx_value_add_reference(env, value, NULL);
if (status != lynx_api_ok) {
  // handle error.
}
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.