summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-24 09:35:56 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-24 09:35:56 +0000
commitb2de05f49a5b064952a224b22d1bb6a9093c4b3b (patch)
tree7520ead6fa7829bbb2cae47d9847025a0bdbfe71 /src
parentf5a98df8ded2946c21464b45068845208bf67c4a (diff)
all efl object deletion functions now take NULL without crashing or erroring
SVN revision: 81667
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore/ecore_anim.c1
-rw-r--r--src/lib/ecore/ecore_events.c3
-rw-r--r--src/lib/ecore/ecore_exe.c1
-rw-r--r--src/lib/ecore/ecore_idle_enterer.c1
-rw-r--r--src/lib/ecore/ecore_idle_exiter.c1
-rw-r--r--src/lib/ecore/ecore_idler.c1
-rw-r--r--src/lib/ecore/ecore_job.c1
-rw-r--r--src/lib/ecore/ecore_main.c2
-rw-r--r--src/lib/ecore/ecore_pipe.c1
-rw-r--r--src/lib/ecore/ecore_poll.c1
-rw-r--r--src/lib/ecore/ecore_timer.c1
-rw-r--r--src/lib/ecore_con/ecore_con.c2
-rw-r--r--src/lib/ecore_evas/ecore_evas.c1
-rw-r--r--src/lib/ecore_file/ecore_file_monitor.c1
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c2
-rw-r--r--src/lib/eio/eio_file.c1
16 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c
index 4ae66a5a2f..f15509091c 100644
--- a/src/lib/ecore/ecore_anim.c
+++ b/src/lib/ecore/ecore_anim.c
@@ -398,6 +398,7 @@ ecore_animator_del(Ecore_Animator *obj)
398{ 398{
399 void *data = NULL; 399 void *data = NULL;
400 400
401 if (!obj) return NULL;
401 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 402 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
402 Ecore_Animator_Private_Data *animator = eo_data_get(obj, MY_CLASS); 403 Ecore_Animator_Private_Data *animator = eo_data_get(obj, MY_CLASS);
403 _ecore_lock(); 404 _ecore_lock();
diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c
index 2d8ac1f661..3405e3d62c 100644
--- a/src/lib/ecore/ecore_events.c
+++ b/src/lib/ecore/ecore_events.c
@@ -128,6 +128,7 @@ ecore_event_handler_del(Ecore_Event_Handler *event_handler)
128{ 128{
129 void *data = NULL; 129 void *data = NULL;
130 130
131 if (!event_handler) return NULL;
131 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 132 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
132 _ecore_lock(); 133 _ecore_lock();
133 if (!ECORE_MAGIC_CHECK(event_handler, ECORE_MAGIC_EVENT_HANDLER)) 134 if (!ECORE_MAGIC_CHECK(event_handler, ECORE_MAGIC_EVENT_HANDLER))
@@ -215,6 +216,7 @@ ecore_event_del(Ecore_Event *event)
215{ 216{
216 void *data = NULL; 217 void *data = NULL;
217 218
219 if (!event) return NULL;
218 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 220 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
219 _ecore_lock(); 221 _ecore_lock();
220 if (!ECORE_MAGIC_CHECK(event, ECORE_MAGIC_EVENT)) 222 if (!ECORE_MAGIC_CHECK(event, ECORE_MAGIC_EVENT))
@@ -272,6 +274,7 @@ ecore_event_filter_del(Ecore_Event_Filter *ef)
272{ 274{
273 void *data = NULL; 275 void *data = NULL;
274 276
277 if (!ef) return NULL;
275 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 278 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
276 _ecore_lock(); 279 _ecore_lock();
277 if (!ECORE_MAGIC_CHECK(ef, ECORE_MAGIC_EVENT_FILTER)) 280 if (!ECORE_MAGIC_CHECK(ef, ECORE_MAGIC_EVENT_FILTER))
diff --git a/src/lib/ecore/ecore_exe.c b/src/lib/ecore/ecore_exe.c
index 36347f687d..b699656951 100644
--- a/src/lib/ecore/ecore_exe.c
+++ b/src/lib/ecore/ecore_exe.c
@@ -1068,6 +1068,7 @@ ecore_exe_free(Ecore_Exe *exe)
1068 int ok = 0; 1068 int ok = 0;
1069 int result; 1069 int result;
1070 1070
1071 if (!exe) return NULL;
1071 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 1072 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
1072 if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE)) 1073 if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
1073 { 1074 {
diff --git a/src/lib/ecore/ecore_idle_enterer.c b/src/lib/ecore/ecore_idle_enterer.c
index 64956ad7b7..ab0326a654 100644
--- a/src/lib/ecore/ecore_idle_enterer.c
+++ b/src/lib/ecore/ecore_idle_enterer.c
@@ -157,6 +157,7 @@ ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer)
157{ 157{
158 void *data = NULL; 158 void *data = NULL;
159 159
160 if (!idle_enterer) return NULL;
160 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 161 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
161 162
162 _ecore_lock(); 163 _ecore_lock();
diff --git a/src/lib/ecore/ecore_idle_exiter.c b/src/lib/ecore/ecore_idle_exiter.c
index 8fd20e7a0a..ac19dac31d 100644
--- a/src/lib/ecore/ecore_idle_exiter.c
+++ b/src/lib/ecore/ecore_idle_exiter.c
@@ -110,6 +110,7 @@ ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter)
110{ 110{
111 void *data; 111 void *data;
112 112
113 if (!idle_exiter) return NULL;
113 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 114 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
114 115
115 _ecore_lock(); 116 _ecore_lock();
diff --git a/src/lib/ecore/ecore_idler.c b/src/lib/ecore/ecore_idler.c
index 147b3c1880..0f6af7d9cd 100644
--- a/src/lib/ecore/ecore_idler.c
+++ b/src/lib/ecore/ecore_idler.c
@@ -91,6 +91,7 @@ ecore_idler_del(Ecore_Idler *idler)
91{ 91{
92 void *data = NULL; 92 void *data = NULL;
93 93
94 if (!idler) return NULL;
94 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 95 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
95 96
96 _ecore_lock(); 97 _ecore_lock();
diff --git a/src/lib/ecore/ecore_job.c b/src/lib/ecore/ecore_job.c
index bc438b7209..4ebdc63f07 100644
--- a/src/lib/ecore/ecore_job.c
+++ b/src/lib/ecore/ecore_job.c
@@ -122,6 +122,7 @@ ecore_job_del(Ecore_Job *obj)
122{ 122{
123 void *data; 123 void *data;
124 124
125 if (!obj) return NULL;
125 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 126 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
126 Ecore_Job_Private_Data *job = eo_data_get(obj, MY_CLASS); 127 Ecore_Job_Private_Data *job = eo_data_get(obj, MY_CLASS);
127 data = job->data; 128 data = job->data;
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 069283ac21..9f531361f9 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -1174,6 +1174,7 @@ ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler)
1174{ 1174{
1175 void *ret = NULL; 1175 void *ret = NULL;
1176 1176
1177 if (!fd_handler) return NULL;
1177 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 1178 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
1178 _ecore_lock(); 1179 _ecore_lock();
1179 1180
@@ -1193,6 +1194,7 @@ unlock:
1193EAPI void * 1194EAPI void *
1194ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler) 1195ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler)
1195{ 1196{
1197 if (!win32_handler) return NULL;
1196 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 1198 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
1197 if (!ECORE_MAGIC_CHECK(win32_handler, ECORE_MAGIC_WIN32_HANDLER)) 1199 if (!ECORE_MAGIC_CHECK(win32_handler, ECORE_MAGIC_WIN32_HANDLER))
1198 { 1200 {
diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c
index de7e5f4e78..1159e82d8d 100644
--- a/src/lib/ecore/ecore_pipe.c
+++ b/src/lib/ecore/ecore_pipe.c
@@ -142,6 +142,7 @@ EAPI void *
142ecore_pipe_del(Ecore_Pipe *p) 142ecore_pipe_del(Ecore_Pipe *p)
143{ 143{
144 void *r; 144 void *r;
145 if (!p) return NULL;
145 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 146 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
146 _ecore_lock(); 147 _ecore_lock();
147 r = _ecore_pipe_del(p); 148 r = _ecore_pipe_del(p);
diff --git a/src/lib/ecore/ecore_poll.c b/src/lib/ecore/ecore_poll.c
index 28be53857c..797fe84572 100644
--- a/src/lib/ecore/ecore_poll.c
+++ b/src/lib/ecore/ecore_poll.c
@@ -392,6 +392,7 @@ ecore_poller_del(Ecore_Poller *obj)
392{ 392{
393 void *data; 393 void *data;
394 394
395 if (!obj) return NULL;
395 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 396 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
396 Ecore_Poller_Private_Data *poller = eo_data_get(obj, MY_CLASS); 397 Ecore_Poller_Private_Data *poller = eo_data_get(obj, MY_CLASS);
397 /* we are walking the poller list - a bad idea to remove from it while 398 /* we are walking the poller list - a bad idea to remove from it while
diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c
index 81a1ba2da0..7bde05561c 100644
--- a/src/lib/ecore/ecore_timer.c
+++ b/src/lib/ecore/ecore_timer.c
@@ -272,6 +272,7 @@ ecore_timer_del(Ecore_Timer *timer)
272{ 272{
273 void *data = NULL; 273 void *data = NULL;
274 274
275 if (!timer) return NULL;
275 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 276 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
276 _ecore_lock(); 277 _ecore_lock();
277 278
diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index 056db2eec0..a50b792e0d 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -552,6 +552,7 @@ ecore_con_server_timeout_get(Ecore_Con_Server *svr)
552EAPI void * 552EAPI void *
553ecore_con_server_del(Ecore_Con_Server *svr) 553ecore_con_server_del(Ecore_Con_Server *svr)
554{ 554{
555 if (!svr) return NULL;
555 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) 556 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
556 { 557 {
557 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_del"); 558 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_del");
@@ -854,6 +855,7 @@ ecore_con_client_timeout_get(Ecore_Con_Client *cl)
854EAPI void * 855EAPI void *
855ecore_con_client_del(Ecore_Con_Client *cl) 856ecore_con_client_del(Ecore_Con_Client *cl)
856{ 857{
858 if (!cl) return NULL;
857 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) 859 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))
858 { 860 {
859 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, "ecore_con_client_del"); 861 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, "ecore_con_client_del");
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 806fa03e3a..7d4edaef42 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -699,6 +699,7 @@ ecore_evas_ecore_evas_get(const Evas *e)
699EAPI void 699EAPI void
700ecore_evas_free(Ecore_Evas *ee) 700ecore_evas_free(Ecore_Evas *ee)
701{ 701{
702 if (!ee) return;
702 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 703 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
703 { 704 {
704 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, 705 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
diff --git a/src/lib/ecore_file/ecore_file_monitor.c b/src/lib/ecore_file/ecore_file_monitor.c
index 6b6fb32349..c7e5e8a3af 100644
--- a/src/lib/ecore_file/ecore_file_monitor.c
+++ b/src/lib/ecore_file/ecore_file_monitor.c
@@ -67,6 +67,7 @@ ecore_file_monitor_add(const char *path,
67EAPI void 67EAPI void
68ecore_file_monitor_del(Ecore_File_Monitor *em) 68ecore_file_monitor_del(Ecore_File_Monitor *em)
69{ 69{
70 if (!em) return;
70 EINA_SAFETY_ON_NULL_RETURN(em); 71 EINA_SAFETY_ON_NULL_RETURN(em);
71 ecore_file_monitor_backend_del(em); 72 ecore_file_monitor_backend_del(em);
72} 73}
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index 2953bf0eac..6b5310f968 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -458,6 +458,7 @@ ecore_ipc_server_del(Ecore_Ipc_Server *svr)
458{ 458{
459 void *data; 459 void *data;
460 460
461 if (!svr) return NULL;
461 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) 462 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
462 { 463 {
463 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, 464 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER,
@@ -874,6 +875,7 @@ ecore_ipc_client_del(Ecore_Ipc_Client *cl)
874 void *data; 875 void *data;
875 Ecore_Ipc_Server *svr; 876 Ecore_Ipc_Server *svr;
876 877
878 if (!cl) return NULL;
877 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) 879 if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT))
878 { 880 {
879 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, 881 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT,
diff --git a/src/lib/eio/eio_file.c b/src/lib/eio/eio_file.c
index ffcd2a73ad..431d088e69 100644
--- a/src/lib/eio/eio_file.c
+++ b/src/lib/eio/eio_file.c
@@ -846,6 +846,7 @@ eio_file_stat_ls(const char *dir,
846EAPI Eina_Bool 846EAPI Eina_Bool
847eio_file_cancel(Eio_File *ls) 847eio_file_cancel(Eio_File *ls)
848{ 848{
849 if (!ls) return EINA_FALSE;
849 EINA_SAFETY_ON_NULL_RETURN_VAL(ls, EINA_FALSE); 850 EINA_SAFETY_ON_NULL_RETURN_VAL(ls, EINA_FALSE);
850 return ecore_thread_cancel(ls->thread); 851 return ecore_thread_cancel(ls->thread);
851} 852}