summaryrefslogtreecommitdiff
path: root/src/lib/elocation
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:24 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:58 -0800
commit21ba61be73f0c9109d40aee7759861ed04fadd35 (patch)
tree93657a9bd58d31a58256ff7017f283bd9650fd69 /src/lib/elocation
parentc91b4c70653527546afbc324b94e4ed60cdfd784 (diff)
elocation: avoid crash during shutdown due to Ecore_Event queue.
Diffstat (limited to 'src/lib/elocation')
-rw-r--r--src/lib/elocation/elocation.c85
1 files changed, 39 insertions, 46 deletions
diff --git a/src/lib/elocation/elocation.c b/src/lib/elocation/elocation.c
index 7583fabe1a..79cd1255f5 100644
--- a/src/lib/elocation/elocation.c
+++ b/src/lib/elocation/elocation.c
@@ -40,20 +40,20 @@ static char nmea_sentence[256];
40int _elocation_log_dom = -1; 40int _elocation_log_dom = -1;
41 41
42/* Elocation ecore event types we provide to the application. */ 42/* Elocation ecore event types we provide to the application. */
43EAPI int ELOCATION_EVENT_STATUS; 43EAPI int ELOCATION_EVENT_STATUS = 0;
44EAPI int ELOCATION_EVENT_POSITION; 44EAPI int ELOCATION_EVENT_POSITION = 0;
45EAPI int ELOCATION_EVENT_ADDRESS; 45EAPI int ELOCATION_EVENT_ADDRESS = 0;
46EAPI int ELOCATION_EVENT_VELOCITY; 46EAPI int ELOCATION_EVENT_VELOCITY = 0;
47EAPI int ELOCATION_EVENT_GEOCODE; 47EAPI int ELOCATION_EVENT_GEOCODE = 0;
48EAPI int ELOCATION_EVENT_REVERSEGEOCODE; 48EAPI int ELOCATION_EVENT_REVERSEGEOCODE = 0;
49EAPI int ELOCATION_EVENT_NMEA; 49EAPI int ELOCATION_EVENT_NMEA = 0;
50EAPI int ELOCATION_EVENT_SATELLITE; 50EAPI int ELOCATION_EVENT_SATELLITE = 0;
51EAPI int ELOCATION_EVENT_POI; 51EAPI int ELOCATION_EVENT_POI = 0;
52EAPI int ELOCATION_EVENT_META_READY; 52EAPI int ELOCATION_EVENT_META_READY = 0;
53 53
54/* Internal events */ 54/* Internal events */
55int ELOCATION_EVENT_IN; 55int ELOCATION_EVENT_IN = 0;
56int ELOCATION_EVENT_OUT; 56int ELOCATION_EVENT_OUT = 0;
57 57
58static void 58static void
59_dummy_free(void *user_data EINA_UNUSED, void *func_data EINA_UNUSED) 59_dummy_free(void *user_data EINA_UNUSED, void *func_data EINA_UNUSED)
@@ -1254,40 +1254,20 @@ elocation_init(void)
1254 1254
1255 /* Create all ecore event types we send out to interested applications */ 1255 /* Create all ecore event types we send out to interested applications */
1256 if (ELOCATION_EVENT_IN == 0) 1256 if (ELOCATION_EVENT_IN == 0)
1257 ELOCATION_EVENT_IN = ecore_event_type_new(); 1257 {
1258 1258 ELOCATION_EVENT_IN = ecore_event_type_new();
1259 if (ELOCATION_EVENT_OUT == 0) 1259 ELOCATION_EVENT_OUT = ecore_event_type_new();
1260 ELOCATION_EVENT_OUT = ecore_event_type_new(); 1260 ELOCATION_EVENT_STATUS = ecore_event_type_new();
1261 1261 ELOCATION_EVENT_POSITION = ecore_event_type_new();
1262 if (ELOCATION_EVENT_STATUS == 0) 1262 ELOCATION_EVENT_ADDRESS = ecore_event_type_new();
1263 ELOCATION_EVENT_STATUS = ecore_event_type_new(); 1263 ELOCATION_EVENT_VELOCITY = ecore_event_type_new();
1264 1264 ELOCATION_EVENT_GEOCODE = ecore_event_type_new();
1265 if (ELOCATION_EVENT_POSITION == 0) 1265 ELOCATION_EVENT_REVERSEGEOCODE = ecore_event_type_new();
1266 ELOCATION_EVENT_POSITION = ecore_event_type_new(); 1266 ELOCATION_EVENT_NMEA = ecore_event_type_new();
1267 1267 ELOCATION_EVENT_SATELLITE = ecore_event_type_new();
1268 if (ELOCATION_EVENT_ADDRESS == 0) 1268 ELOCATION_EVENT_POI = ecore_event_type_new();
1269 ELOCATION_EVENT_ADDRESS = ecore_event_type_new(); 1269 ELOCATION_EVENT_META_READY = ecore_event_type_new();
1270 1270 }
1271 if (ELOCATION_EVENT_VELOCITY == 0)
1272 ELOCATION_EVENT_VELOCITY = ecore_event_type_new();
1273
1274 if (ELOCATION_EVENT_GEOCODE == 0)
1275 ELOCATION_EVENT_GEOCODE = ecore_event_type_new();
1276
1277 if (ELOCATION_EVENT_REVERSEGEOCODE == 0)
1278 ELOCATION_EVENT_REVERSEGEOCODE = ecore_event_type_new();
1279
1280 if (ELOCATION_EVENT_NMEA == 0)
1281 ELOCATION_EVENT_NMEA = ecore_event_type_new();
1282
1283 if (ELOCATION_EVENT_SATELLITE == 0)
1284 ELOCATION_EVENT_SATELLITE = ecore_event_type_new();
1285
1286 if (ELOCATION_EVENT_POI == 0)
1287 ELOCATION_EVENT_POI = ecore_event_type_new();
1288
1289 if (ELOCATION_EVENT_META_READY == 0)
1290 ELOCATION_EVENT_META_READY = ecore_event_type_new();
1291 1271
1292 obj_master= eldbus_object_get(conn, GEOCLUE_DBUS_NAME, GEOCLUE_OBJECT_PATH); 1272 obj_master= eldbus_object_get(conn, GEOCLUE_DBUS_NAME, GEOCLUE_OBJECT_PATH);
1293 if (!obj_master) 1273 if (!obj_master)
@@ -1370,6 +1350,19 @@ elocation_shutdown(void)
1370 } 1350 }
1371 } 1351 }
1372 1352
1353 ecore_event_type_flush(ELOCATION_EVENT_IN,
1354 ELOCATION_EVENT_OUT,
1355 ELOCATION_EVENT_STATUS,
1356 ELOCATION_EVENT_POSITION,
1357 ELOCATION_EVENT_ADDRESS,
1358 ELOCATION_EVENT_VELOCITY,
1359 ELOCATION_EVENT_GEOCODE,
1360 ELOCATION_EVENT_REVERSEGEOCODE,
1361 ELOCATION_EVENT_NMEA,
1362 ELOCATION_EVENT_SATELLITE,
1363 ELOCATION_EVENT_POI,
1364 ELOCATION_EVENT_META_READY);
1365
1373 /* Quite a bit of allocated string and generic memory cleanup. This should be 1366 /* Quite a bit of allocated string and generic memory cleanup. This should be
1374 *less when we went away from all this global var business. 1367 *less when we went away from all this global var business.
1375 */ 1368 */