summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2_client.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-08-01 18:39:38 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:13 +0900
commita230e41409b21c05fab6a47ea2a5510ac848d9d1 (patch)
tree9d9c81e0b5df461c460f3680e49d2bac2445fb33 /src/lib/evas/cserve2/evas_cs2_client.c
parentf5d0f0aec37fae9e974ce1b5b2e518863297ba3f (diff)
evas/cserve2: Fix Eina_File leak at shutdown
cserve2_shutdown was not called
Diffstat (limited to '')
-rw-r--r--src/lib/evas/cserve2/evas_cs2_client.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index 5b8e463f10..6e65158733 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -308,12 +308,14 @@ int
308evas_cserve2_shutdown(void) 308evas_cserve2_shutdown(void)
309{ 309{
310 const char zeros[sizeof(Msg_Index_List)] = {0}; 310 const char zeros[sizeof(Msg_Index_List)] = {0};
311 Msg_Index_List *empty = (Msg_Index_List *) zeros;
311 312
312 if ((--cserve2_init) > 0) 313 if ((--cserve2_init) > 0)
313 return cserve2_init; 314 return cserve2_init;
314 315
315 DBG("Disconnecting from cserve2."); 316 DBG("Disconnecting from cserve2.");
316 _server_index_list_set((Msg_Base *) zeros, sizeof(Msg_Index_List)); 317 empty->base.type = CSERVE2_INDEX_LIST;
318 _server_index_list_set((Msg_Base *) empty, sizeof(Msg_Index_List));
317 _server_disconnect(); 319 _server_disconnect();
318 320
319 return cserve2_init; 321 return cserve2_init;
@@ -1948,7 +1950,21 @@ _shared_index_remap_check(Shared_Index *si, int elemsize)
1948 1950
1949 // Note: all checks are unlikely to be true. 1951 // Note: all checks are unlikely to be true.
1950 1952
1951 if (!si || elemsize <= 0) return EINA_FALSE; 1953 if (!si || elemsize <= 0)
1954 return EINA_FALSE;
1955
1956 if (!si->path[0])
1957 {
1958 if (si->f)
1959 {
1960 DBG("Closing index map");
1961 eina_file_map_free(si->f, si->data);
1962 eina_file_close(si->f);
1963 eina_hash_free(si->entries_by_hkey);
1964 memset(si, 0, sizeof(*si));
1965 }
1966 return EINA_FALSE;
1967 }
1952 1968
1953 if (si->generation_id != _index.generation_id) 1969 if (si->generation_id != _index.generation_id)
1954 { 1970 {