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 [email protected]
This commit is contained in:
Martijn Thé authored and László Langó committed 2018-03-01 09:31:39 +01:00
1 parent ccc283289c
commit 26ee8f7137
4 files changed
+30 -5

No files matched your search

+1 -1
View File
@@ -217,7 +217,7 @@ typedef bool (*jerry_object_property_foreach_t) (const jerry_value_t property_na
typedef struct
{
void (*init_cb) (void *); /**< callback responsible for initializing a context item, or NULL to zero out the memory */
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;