summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzmike <michael.blumenkrantz@gmail.com>2014-02-05 21:24:02 -0500
committerzmike <michael.blumenkrantz@gmail.com>2014-02-05 21:24:02 -0500
commit20eea5f203e175b776f224a02b2906f5ae1fcdba (patch)
treea57655867db44e0d7b5c1a3d0e77bb6de0d70e61
parent9a4e72bc6e134c7da49e8063f560f7affce62026 (diff)
add shutdown function
-rw-r--r--excetra.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/excetra.c b/excetra.c
index 2906db7..049066a 100644
--- a/excetra.c
+++ b/excetra.c
@@ -15,6 +15,8 @@ int excetra_log_dom = -1;
15#define LYRICWIKI_SEARCH_TRACK_SIZE sizeof("http://lyrics.wikia.com/api.php?artist=&song=&fmt=json") 15#define LYRICWIKI_SEARCH_TRACK_SIZE sizeof("http://lyrics.wikia.com/api.php?artist=&song=&fmt=json")
16#define LYRICWIKI_SEARCH_TRACK "http://lyrics.wikia.com/api.php?artist=" 16#define LYRICWIKI_SEARCH_TRACK "http://lyrics.wikia.com/api.php?artist="
17 17
18static Ecore_Event_Handler *handler_data;
19static Ecore_Event_Handler *handler_done;
18 20
19Eina_Bool 21Eina_Bool
20lyricwiki_data(void *d EINA_UNUSED, int type EINA_UNUSED, Ecore_Con_Event_Url_Data *ev) 22lyricwiki_data(void *d EINA_UNUSED, int type EINA_UNUSED, Ecore_Con_Event_Url_Data *ev)
@@ -184,11 +186,27 @@ excetra_init(void)
184 } 186 }
185 evas_init(); 187 evas_init();
186 azy_init(); 188 azy_init();
187 ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, (Ecore_Event_Handler_Cb)lyricwiki_complete, NULL); 189 handler_done = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, (Ecore_Event_Handler_Cb)lyricwiki_complete, NULL);
188 ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA, (Ecore_Event_Handler_Cb)lyricwiki_data, NULL); 190 handler_data = ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA, (Ecore_Event_Handler_Cb)lyricwiki_data, NULL);
189 return 1; 191 return 1;
190} 192}
191 193
194void
195excetra_shutdown(void)
196{
197 ecore_event_handler_del(handler_done);
198 handler_done = NULL;
199 ecore_event_handler_del(handler_data);
200 handler_data = NULL;
201 azy_shutdown();
202 evas_shutdown();
203 ecore_con_url_shutdown();
204 eina_log_domain_unregister(excetra_log_dom);
205 excetra_log_dom = -1;
206 ecore_shutdown();
207 eina_shutdown();
208}
209
192int 210int
193main(int argc, char *argv[]) 211main(int argc, char *argv[])
194{ 212{