summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--navit/vehicle/gpsd/vehicle_gpsd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c
index 7544d037d..92d663ef9 100644
--- a/navit/vehicle/gpsd/vehicle_gpsd.c
+++ b/navit/vehicle/gpsd/vehicle_gpsd.c
@@ -236,6 +236,7 @@ static int vehicle_gpsd_try_open(struct vehicle_priv *priv) {
priv->gps = gps_open(source + 7, port);
if(!priv->gps) {
#endif
+ priv->cbt = callback_new_1(callback_cast(vehicle_gpsd_try_open), priv);
dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?", priv->source,
priv->retry_interval);
g_free(source);
@@ -312,10 +313,11 @@ static void vehicle_gpsd_close(struct vehicle_priv *priv) {
}
if (priv->gps) {
gps_close(priv->gps);
-#if GPSD_API_MAJOR_VERSION >= 5
- g_free(priv->gps);
-#endif
- priv->gps = NULL;
+//if we release the gps object a reconnect is no longer working.
+//#if GPSD_API_MAJOR_VERSION >= 5
+// g_free(priv->gps);
+//#endif
+// priv->gps = NULL;
}
#ifdef HAVE_GPSBT
err = gpsbt_stop(&priv->context);