Fix a crash after changes that velocity is updated before position 2.0alpha master
authorMinjune Kim <sena06.kim@samsung.com>
Fri, 31 Aug 2012 10:11:02 +0000 (19:11 +0900)
committerMinjune Kim <sena06.kim@samsung.com>
Fri, 31 Aug 2012 15:17:18 +0000 (00:17 +0900)
Change-Id: I85dd79f95de014f4dc2eadaa8af2082d70477b04

debian/changelog
location/manager/location-cps.c
location/manager/location-gps.c
location/manager/location-hybrid.c
location/manager/location-signaling-util.c
location/manager/location-signaling-util.h
location/manager/location-wps.c
packaging/libslp-location.spec

index 0848fc8..c96f215 100644 (file)
@@ -1,3 +1,10 @@
+libslp-location (0.3.39-1) unstable; urgency=low
+
+  * Fix a crash after changes that velocity is updated before position.
+  * Tag: libslp-location_0.3.39-1
+
+ -- Minjune Kim <sena06.kim@samsung.com>  Fri, 31 Aug 2012 19:02:39 +0900
+
 libslp-location (0.3.38-1) unstable; urgency=low
 
   * Add the parameter, LocationMapPref in Geocoder
index 5e3b43e..5b76627 100644 (file)
@@ -179,7 +179,7 @@ cps_position_cb (gboolean enabled,
        }
 
        enable_signaling(self, signals, &(priv->enabled), enabled, pos->status);
-       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, FALSE, &(priv->pos_updated_timestamp), &(priv->pos), &(priv->acc), priv->boundary_list, &(priv->zone_status), pos, acc);
+       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, FALSE, &(priv->pos_updated_timestamp), &(priv->pos), priv->boundary_list, &(priv->zone_status), pos, acc);
 }
 
 static void
@@ -191,7 +191,7 @@ cps_velocity_cb(gboolean enabled,
        LOCATION_LOGD("cps_velocity_cb");
        g_return_if_fail(self);
        LocationCpsPrivate* priv = GET_PRIVATE(self);
-       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, FALSE, &(priv->vel_updated_timestamp), &(priv->vel), vel, acc);
+       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, FALSE, &(priv->vel_updated_timestamp), &(priv->vel), &(priv->acc), vel, acc);
 }
 
 static void
index 12fee81..a3b44ec 100644 (file)
@@ -182,7 +182,7 @@ gps_position_cb (gboolean enabled,
        LocationGpsPrivate* priv = GET_PRIVATE(self);
 
        enable_signaling(self, signals, &(priv->enabled), enabled, pos->status);
-       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, TRUE, &(priv->pos_updated_timestamp), &(priv->pos), &(priv->acc), priv->boundary_list, &(priv->zone_status), pos, acc);
+       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, TRUE, &(priv->pos_updated_timestamp), &(priv->pos), priv->boundary_list, &(priv->zone_status), pos, acc);
 
 }
 
@@ -195,7 +195,7 @@ gps_velocity_cb (gboolean enabled,
        LOCATION_LOGD("gps_velocity_cb");
        g_return_if_fail(self);
        LocationGpsPrivate* priv = GET_PRIVATE(self);
-       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, TRUE, &(priv->vel_updated_timestamp), &(priv->vel), vel, acc);
+       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, TRUE, &(priv->vel_updated_timestamp), &(priv->vel), &(priv->acc), vel, acc);
 }
 
 static void
index e8c906c..de6b6ec 100644 (file)
@@ -308,10 +308,10 @@ hybrid_service_updated (GObject *obj,
        if (hybrid_compare_g_type_method(priv, g_type)) {
                LocationAccuracy *acc = (LocationAccuracy*)accuracy;
                if (type == POSITION_UPDATED) {
-                       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, TRUE, &(priv->pos_updated_timestamp), &(priv->pos), &(priv->acc), priv->boundary_list, &(priv->zone_status), pos, acc);
+                       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, TRUE, &(priv->pos_updated_timestamp), &(priv->pos), priv->boundary_list, &(priv->zone_status), pos, acc);
                        LOCATION_LOGW("Position updated. timestamp [%d]", priv->pos->timestamp);
                } else if (type == VELOCITY_UPDATED) {
-                       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, TRUE, &(priv->vel_updated_timestamp), &(priv->vel), vel, acc);
+                       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, TRUE, &(priv->vel_updated_timestamp), &(priv->vel), &(priv->acc), vel, acc);
                        LOCATION_LOGW("Velocity updated. timestamp [%d]", priv->vel->timestamp);
                }
 
index 7b11c3f..e262bda 100644 (file)
@@ -55,7 +55,6 @@ position_signaling (LocationObject *obj,
        gboolean emit,
        guint *updated_timestamp,
        LocationPosition **prev_pos,
-       LocationAccuracy **prev_acc,
        GList *prev_bound,
        ZoneStatus *zone_status,
        const LocationPosition *pos,
@@ -75,10 +74,8 @@ position_signaling (LocationObject *obj,
        if (!pos->timestamp)    return;
 
        if (*prev_pos) location_position_free (*prev_pos);
-       if (*prev_acc) location_accuracy_free (*prev_acc);
 
        *prev_pos = location_position_copy(pos);
-       *prev_acc = location_accuracy_copy(acc);
        LOCATION_LOGD("timestamp[%d], lat [%f], lon [%f]", (*prev_pos)->timestamp, (*prev_pos)->latitude, (*prev_pos)->longitude);
 
        if (emit && pos->timestamp - *updated_timestamp >= interval) {
@@ -121,6 +118,7 @@ velocity_signaling (LocationObject *obj,
        gboolean emit,
        guint *updated_timestamp,
        LocationVelocity **prev_vel,
+       LocationAccuracy **prev_acc,
        const LocationVelocity *vel,
        const LocationAccuracy *acc)
 {
@@ -131,7 +129,10 @@ velocity_signaling (LocationObject *obj,
        if (!vel->timestamp) return;
 
        if (*prev_vel) location_velocity_free (*prev_vel);
+       if (*prev_acc) location_accuracy_free (*prev_acc);
+
        *prev_vel = location_velocity_copy (vel);
+       *prev_acc = location_accuracy_copy (acc);
        LOCATION_LOGD("timestamp[%d]", (*prev_vel)->timestamp);
 
        if (emit && vel->timestamp - *updated_timestamp >= interval) {
index 8854169..db2504e 100644 (file)
@@ -42,13 +42,13 @@ void enable_signaling (LocationObject *obj, guint32 signals[LAST_SIGNAL], gboole
 
 void position_signaling (LocationObject *obj, guint32 signals[LAST_SIGNAL],
                gboolean *prev_enabled, int interval, gboolean emit,
-               guint *updated_interval, LocationPosition **prev_pos, LocationAccuracy **prev_acc,
+               guint *updated_interval, LocationPosition **prev_pos,
                GList *prev_bound, ZoneStatus *zone_status,
                const LocationPosition *pos, const LocationAccuracy *acc);
 
 void velocity_signaling (LocationObject* obj, guint32 signals[LAST_SIGNAL],
                gboolean *prev_enabled, int interval, gboolean emit,
-               guint *updated_timestamp, LocationVelocity **prev_vel,
+               guint *updated_timestamp, LocationVelocity **prev_vel, LocationAccuracy **prev_acc,
                const LocationVelocity *vel, const LocationAccuracy *acc);
 
 void satellite_signaling(LocationObject *obj, guint32 signals[LAST_SIGNAL],
index 88a871a..7d94438 100644 (file)
@@ -183,7 +183,7 @@ wps_position_cb (gboolean enabled,
        }
 
        enable_signaling(self, signals, &(priv->enabled), enabled, pos->status);
-       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, FALSE, &(priv->pos_updated_timestamp), &(priv->pos), &(priv->acc), priv->boundary_list, &(priv->zone_status), pos, acc);
+       position_signaling(self, signals, &(priv->enabled), priv->pos_interval, FALSE, &(priv->pos_updated_timestamp), &(priv->pos), priv->boundary_list, &(priv->zone_status), pos, acc);
 }
 
 static void
@@ -195,7 +195,7 @@ wps_velocity_cb(gboolean enabled,
        LOCATION_LOGD("wps_velocity_cb");
        g_return_if_fail(self);
        LocationWpsPrivate* priv = GET_PRIVATE(self);
-       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, FALSE, &(priv->vel_updated_timestamp), &(priv->vel), vel, acc);
+       velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, FALSE, &(priv->vel_updated_timestamp), &(priv->vel), &(priv->acc), vel, acc);
 }
 
 static void
index add3f10..b11d718 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libslp-location
 Summary:    Location Based Service
-Version:    0.3.38
+Version:    0.3.39
 Release:    1
 Group:      System/Libraries
 License:    TBD