From d03b2dafba72ffd544209ca5107d19a658cbc826 Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Mon, 12 Jan 2015 19:02:42 +0300 Subject: [PATCH] Upon receiving 'give some memory back' request check if any corresponding callback set instead of asserting that. --- LICENSE | 2 +- src/liballocator/mem-allocator.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index bd3608451..b444cdec5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2014 Samsung Electronics Co., Ltd. +Copyright 2014-2015 Samsung Electronics Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/liballocator/mem-allocator.c b/src/liballocator/mem-allocator.c index 576508b2b..1c670423c 100644 --- a/src/liballocator/mem-allocator.c +++ b/src/liballocator/mem-allocator.c @@ -1,4 +1,4 @@ -/* Copyright 2014 Samsung Electronics Co., Ltd. +/* Copyright 2014-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,9 +166,10 @@ void mem_run_try_to_give_memory_back_callbacks (mem_try_give_memory_back_severity_t severity) /**< severity of the request */ { - JERRY_ASSERT (mem_try_give_memory_back_callback != NULL); - - mem_try_give_memory_back_callback (severity); + if (mem_try_give_memory_back_callback != NULL) + { + mem_try_give_memory_back_callback (severity); + } } /* mem_run_try_to_give_memory_back_callbacks */ #ifndef JERRY_NDEBUG