svace : single_request 12/121912/1 accepted/tizen/3.0/common/20170330.125427 accepted/tizen/3.0/ivi/20170330.042824 accepted/tizen/3.0/mobile/20170330.042426 accepted/tizen/3.0/tv/20170330.042628 accepted/tizen/3.0/wearable/20170330.042730 submit/tizen_3.0/20170329.112748
authorkj7.sung <kj7.sung@samsung.com>
Wed, 29 Mar 2017 10:17:47 +0000 (19:17 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Wed, 29 Mar 2017 10:17:47 +0000 (19:17 +0900)
Change-Id: Ia0c5c7981d562248f30bc25a512e83e27d7be471
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
src/locations.c

index ee7c7fc869280f1fc996864185d9e0ba2b369acf..a5437ab4f82d922d266e78d777c9cbb194a7c498 100755 (executable)
@@ -112,16 +112,20 @@ static void __cb_service_updated(GObject *self, guint type, gpointer data, gpoin
 
 static void __cb_location_updated(GObject *self, int error, gpointer position, gpointer velocity, gpointer accuracy, gpointer userdata)
 {
-       LOCATIONS_LOGD("Callback function has been invoked. ");
        int converted_err = __convert_error_code(error);
        location_manager_s *handle = (location_manager_s *) userdata;
        LocationPosition *pos = (LocationPosition *) position;
        LocationVelocity *vel = (LocationVelocity *) velocity;
 
-       LOCATIONS_LOGD("Current position: timestamp : %d", pos->timestamp);
+       LOCATIONS_LOGD("Callback function[TYPE_LOCATION: single]  timestamp : %d, error : %d", pos->timestamp, error);
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_LOCATION]) {
                ((location_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_LOCATION])(converted_err, pos->latitude, pos->longitude, pos->altitude,
-                                                                                                                                                               pos->timestamp, vel->speed, vel->climb, vel->direction, handle->user_data[_LOCATIONS_EVENT_TYPE_LOCATION]);
+                                                               pos->timestamp, vel->speed, vel->direction, vel->climb, handle->user_data[_LOCATIONS_EVENT_TYPE_LOCATION]);
+       }
+
+       if (error != LOCATION_ERROR_NONE) {
+               location_position_free(pos);
+               location_velocity_free(vel);
        }
 }