svace : single_request 37/121937/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170330.151812 accepted/tizen/ivi/20170330.224119 accepted/tizen/mobile/20170330.223852 accepted/tizen/tv/20170330.223916 accepted/tizen/unified/20170330.224201 accepted/tizen/wearable/20170330.223929 submit/tizen/20170330.051533
authorkj7.sung <kj7.sung@samsung.com>
Wed, 29 Mar 2017 10:52:52 +0000 (19:52 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Wed, 29 Mar 2017 10:52:52 +0000 (19:52 +0900)
Change-Id: I5af870d1a324f153bcaa2476cafa95abd60fd8da
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
src/locations.c

index ee7c7fc..a5437ab 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);
        }
 }