diff options
author | Jeonghoon Park <jh1979.park@samsung.com> | 2017-11-08 14:24:23 +0900 |
---|---|---|
committer | Jeonghoon Park <jh1979.park@samsung.com> | 2017-11-08 14:24:23 +0900 |
commit | e3153559ddf99814f699b065d7bddbe10a69c7fd (patch) | |
tree | 96b115c8609bd2b10c05edfed6917b21d2821566 | |
parent | cad28e5476781a40578cf357bdcdaefaed7bcae7 (diff) | |
download | position-finder-server-e3153559ddf99814f699b065d7bddbe10a69c7fd.tar.gz position-finder-server-e3153559ddf99814f699b065d7bddbe10a69c7fd.tar.bz2 position-finder-server-e3153559ddf99814f699b065d7bddbe10a69c7fd.zip |
remove hash table if there is nothing in the hash table to minimize memory
Change-Id: I86140d7bbec589f5753022a2a7d979ed7ad5dd76
-rw-r--r-- | src/connectivity.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/connectivity.c b/src/connectivity.c index a9c695b..d1ef473 100644 --- a/src/connectivity.c +++ b/src/connectivity.c @@ -913,6 +913,11 @@ int connectivity_attributes_remove_value_by_key(connectivity_resource_s *resourc if (resource_info->value_hash) g_hash_table_remove(resource_info->value_hash, key); + if (g_hash_table_size(resource_info->value_hash) == 0) { + g_hash_table_unref(resource_info->value_hash); + resource_info->value_hash = NULL; + } + return 0; } |