This sets memory_limit_hash to NULL after freeing memory
associated with it. This way we can initialize the module
again. It helps with performing consecutive tests
within a single binary.
Change-Id: Icfe2755c1d7689a314d04d0056c9cac05bdafcd7
void lowmem_limit_exit(void)
{
- if (memory_limit_hash)
+ if (memory_limit_hash) {
g_hash_table_destroy(memory_limit_hash);
+#ifdef _UNIT_TEST
+ memory_limit_hash = NULL;
+#endif
+ }
if (mem_service_limit)
unregister_notifier(RESOURCED_NOTIFIER_SERVICE_LAUNCH, lowmem_limit_service);