# Destruction of as\_record

**URL:** <https://discuss.aerospike.com/t/destruction-of-as-record/5268>\
**Category:** C Client Library\
**Created:** [June 20, 2018, 10:24am UTC](https://discuss.aerospike.com/t/destruction-of-as-record/5268 "2018-06-20T10:24:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishal14101993](https://avatars.discourse-cdn.com/v4/letter/v/71e660/32.png) [@vishal14101993](https://discuss.aerospike.com/u/vishal14101993)\
**Post date:** [June 20, 2018, 10:24am UTC](https://discuss.aerospike.com/t/destruction-of-as-record/5268/1 "2018-06-20T10:24:30Z")

</div>

As per [API docs](https://www.aerospike.com/apidocs/c/df/dd6/structas__record.html), ‘as\_record\_destroy’ should be called upon ‘as\_record’ when it is no longer required. In my C++ program, I was thinking of adding a check(as\_record==NULL), to check if it needs to be destroyed or not. Is this required or not?

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [June 21, 2018, 4:45am UTC](https://discuss.aerospike.com/t/destruction-of-as-record/5268/2 "2018-06-21T04:45:26Z")

</div>

No. as\_record\_destroy() already checks for null.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [July 16, 2018, 5:30am UTC](https://discuss.aerospike.com/t/destruction-of-as-record/5268/3 "2018-07-16T05:30:04Z")

</div>

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.
