> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# jsonClose

> jsonOpen が作成した読み取り可能なJSON ハンドルをクローズし、メモリを解放してハンドルのリークを回避します。

[jsonOpen](./op-json-open) が作成した読み取り可能なJSON ハンドルをクローズします。

## 必要なパラメータ

* **handle**：JSON データへの読み取り可能なハンドル参照。

## 例

次の例では、jsonOpen を使用して静的なJSON テキストのハンドルを作成し、そのハンドルを別のオペレーション（この場合は2番目のオペレーションであるjsonDOMGet）に渡します。続いてjsonClose を使用して、jsonOpen が作成したハンドルをクローズします。

```xml theme={null}
<!-- Setting some static JSON text -->
<arc:set attr="json.text" value='{"hello": "world","settings": {"foo": "bar"}}' />
<arc:call op="jsonOpen" in="json" out="output" >
  <!-- Setting the json handle as an attribute on a new item that is passed into a second operation  -->
  <arc:set attr="json2.handle" value="[output.handle]" />
  <arc:set attr="json2.map:value1" value="/json/settings/foo" />
  <arc:call op="jsonDOMGet" in="json2" out="output2" >
    <!-- Here is where you can execute additional script for the operation that is using the handle -->
  </arc:call>

  <!-- Using the arc:finally keyword to execute the closing of the handle last -->
  <arc:finally>
    <!-- Calling jsonClose to close the handle created by jsonOpen -->
    <arc:call op="jsonClose" in="json2" />
  </arc:finally>
</arc:call>
```

<Note>jsonOpen を使用する際は、開いたままのハンドルによるメモリリークを避けるため、必ずjsonClose オペレーションを使用してください。</Note>
