diff options
author | Martijn Thé <martijnthe@users.noreply.github.com> | 2018-03-01 09:31:39 +0100 |
---|---|---|
committer | László Langó <llango.u-szeged@partner.samsung.com> | 2018-03-01 09:31:39 +0100 |
commit | 26ee8f713716f8eba0ac4044188aeb513ecbb0cd (patch) | |
tree | 3f49574939dccae93c16beec5a2bdcbad81eee86 /docs | |
parent | ccc283289c846560d8b63d150b86b3f030363234 (diff) |
Bugfix: check context manager deinit callback for NULL before calling it (#2222)
The deinit_cb should be allowed to be NULL.
JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com
Diffstat (limited to 'docs')
-rw-r--r-- | docs/02.API-REFERENCE.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/02.API-REFERENCE.md b/docs/02.API-REFERENCE.md index 44025b5b..dec8efa0 100644 --- a/docs/02.API-REFERENCE.md +++ b/docs/02.API-REFERENCE.md @@ -122,8 +122,9 @@ typedef uint32_t jerry_value_t; **Summary** Structure that defines how a context data item will be initialized and deinitialized. JerryScript zeroes out the memory -for the item by default, and if the `init_cb` field is not NULL, it will be called with the pointer to the memory as -an additional custom initializer. +for the item by default, and if the `init_cb` field is not NULL, it will be called with the pointer to the memory as +an additional custom initializer. The `deinit_cb` (if non-`NULL`) is called during a call to `jerry_cleanup()` to run +any custom deinitialization. **Prototype** @@ -131,7 +132,7 @@ an additional custom initializer. typedef struct { void (*init_cb) (void *); /**< callback responsible for initializing a context item, or NULL */ - void (*deinit_cb) (void *); /**< callback responsible for deinitializing a context item */ + void (*deinit_cb) (void *); /**< callback responsible for deinitializing a context item, or NULL */ size_t bytes_needed; /**< number of bytes to allocate for this manager */ } jerry_context_data_manager_t; ``` |