summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_job/Ecore_Job.h2
-rw-r--r--legacy/ecore/src/lib/ecore_job/ecore_job.c34
-rw-r--r--legacy/edje/src/lib/edje_main.c10
-rw-r--r--legacy/edje/src/lib/edje_message_queue.c5
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c5
5 files changed, 50 insertions, 6 deletions
diff --git a/legacy/ecore/src/lib/ecore_job/Ecore_Job.h b/legacy/ecore/src/lib/ecore_job/Ecore_Job.h
index bb2da6c1e4..28af30794e 100644
--- a/legacy/ecore/src/lib/ecore_job/Ecore_Job.h
+++ b/legacy/ecore/src/lib/ecore_job/Ecore_Job.h
@@ -35,6 +35,8 @@ extern "C" {
35typedef void Ecore_Job; /**< A job handle */ 35typedef void Ecore_Job; /**< A job handle */
36#endif 36#endif
37 37
38EAPI int ecore_job_init();
39EAPI int ecore_job_shutdown();
38EAPI Ecore_Job *ecore_job_add(void (*func) (void *data), const void *data); 40EAPI Ecore_Job *ecore_job_add(void (*func) (void *data), const void *data);
39EAPI void *ecore_job_del(Ecore_Job *job); 41EAPI void *ecore_job_del(Ecore_Job *job);
40 42
diff --git a/legacy/ecore/src/lib/ecore_job/ecore_job.c b/legacy/ecore/src/lib/ecore_job/ecore_job.c
index b5b9636dac..990ad8734e 100644
--- a/legacy/ecore/src/lib/ecore_job/ecore_job.c
+++ b/legacy/ecore/src/lib/ecore_job/ecore_job.c
@@ -7,6 +7,34 @@ static int _ecore_job_event_handler(void *data, int type, void *ev);
7static void _ecore_job_event_free(void *data, void *ev); 7static void _ecore_job_event_free(void *data, void *ev);
8 8
9static int ecore_event_job_type = 0; 9static int ecore_event_job_type = 0;
10static int _ecore_init_job_count = 0;
11static Ecore_Event_Handler* _ecore_job_handler = NULL;
12
13EAPI int
14ecore_job_init()
15{
16 if (++_ecore_init_job_count == 1)
17 {
18 ecore_init();
19 ecore_event_job_type = ecore_event_type_new();
20 _ecore_job_handler = ecore_event_handler_add(ecore_event_job_type, _ecore_job_event_handler, NULL);
21 }
22
23 return _ecore_init_job_count;
24}
25
26EAPI int
27ecore_job_shutdown()
28{
29 if (--_ecore_init_job_count)
30 return _ecore_init_job_count;
31
32 ecore_event_handler_del(_ecore_job_handler);
33 _ecore_job_handler = NULL;
34 ecore_shutdown();
35
36 return _ecore_init_job_count;
37}
10 38
11/** 39/**
12 * Add a job to the event queue. 40 * Add a job to the event queue.
@@ -24,11 +52,7 @@ ecore_job_add(void (*func) (void *data), const void *data)
24 Ecore_Job *job; 52 Ecore_Job *job;
25 53
26 if (!func) return NULL; 54 if (!func) return NULL;
27 if (!ecore_event_job_type) 55
28 {
29 ecore_event_job_type = ecore_event_type_new();
30 ecore_event_handler_add(ecore_event_job_type, _ecore_job_event_handler, NULL);
31 }
32 job = calloc(1, sizeof(Ecore_Job)); 56 job = calloc(1, sizeof(Ecore_Job));
33 if (!job) return NULL; 57 if (!job) return NULL;
34 ECORE_MAGIC_SET(job, ECORE_MAGIC_JOB); 58 ECORE_MAGIC_SET(job, ECORE_MAGIC_JOB);
diff --git a/legacy/edje/src/lib/edje_main.c b/legacy/edje/src/lib/edje_main.c
index 04c08f55bc..a3372443e1 100644
--- a/legacy/edje/src/lib/edje_main.c
+++ b/legacy/edje/src/lib/edje_main.c
@@ -4,6 +4,8 @@
4 4
5#include <time.h> 5#include <time.h>
6 6
7#include <Ecore_Job.h>
8
7#include "Edje.h" 9#include "Edje.h"
8#include "edje_private.h" 10#include "edje_private.h"
9 11
@@ -21,6 +23,7 @@ edje_init(void)
21 initted++; 23 initted++;
22 if (initted == 1) 24 if (initted == 1)
23 { 25 {
26 ecore_job_init();
24 srand(time(NULL)); 27 srand(time(NULL));
25 _edje_edd_setup(); 28 _edje_edd_setup();
26 _edje_text_init(); 29 _edje_text_init();
@@ -40,6 +43,10 @@ edje_shutdown(void)
40 initted--; 43 initted--;
41 if (initted > 0) return initted; 44 if (initted > 0) return initted;
42 45
46 if (_edje_timer)
47 ecore_animator_del(_edje_timer);
48 _edje_timer = NULL;
49
43 _edje_file_cache_shutdown(); 50 _edje_file_cache_shutdown();
44 _edje_message_shutdown(); 51 _edje_message_shutdown();
45 _edje_edd_free(); 52 _edje_edd_free();
@@ -48,7 +55,8 @@ edje_shutdown(void)
48 _edje_text_class_members_free(); 55 _edje_text_class_members_free();
49 _edje_text_class_hash_free(); 56 _edje_text_class_hash_free();
50 embryo_shutdown(); 57 embryo_shutdown();
51 58 ecore_job_shutdown();
59
52 return 0; 60 return 0;
53} 61}
54 62
diff --git a/legacy/edje/src/lib/edje_message_queue.c b/legacy/edje/src/lib/edje_message_queue.c
index d2a8bab7b8..2f402c85a5 100644
--- a/legacy/edje/src/lib/edje_message_queue.c
+++ b/legacy/edje/src/lib/edje_message_queue.c
@@ -124,7 +124,12 @@ void
124_edje_message_shutdown(void) 124_edje_message_shutdown(void)
125{ 125{
126 _edje_message_queue_clear(); 126 _edje_message_queue_clear();
127 if (job_loss_timer)
128 ecore_timer_del(job_loss_timer);
129 if (job)
130 ecore_job_del(job);
127 job = NULL; 131 job = NULL;
132 job_loss_timer = NULL;
128} 133}
129 134
130void 135void
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 93b7f4d98c..b081747bb3 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -193,12 +193,15 @@ emotion_object_init(Evas_Object *obj, const char *module_filename)
193 sd->seek_pos = 0; 193 sd->seek_pos = 0;
194 sd->len = 0; 194 sd->len = 0;
195 195
196 ecore_job_init();
197
196 if ((!sd->module) || (!sd->video)) 198 if ((!sd->module) || (!sd->video))
197 { 199 {
198 if (!_emotion_module_open(module_filename, obj, 200 if (!_emotion_module_open(module_filename, obj,
199 &sd->module, &sd->video)) 201 &sd->module, &sd->video))
200 return 0; 202 return 0;
201 } 203 }
204
202 return 1; 205 return 1;
203} 206}
204 207
@@ -1183,6 +1186,8 @@ _smart_del(Evas_Object * obj)
1183 if (sd->progress.info) free(sd->progress.info); 1186 if (sd->progress.info) free(sd->progress.info);
1184 if (sd->ref.file) free(sd->ref.file); 1187 if (sd->ref.file) free(sd->ref.file);
1185 free(sd); 1188 free(sd);
1189
1190 ecore_job_shutdown();
1186} 1191}
1187 1192
1188static void 1193static void