summaryrefslogtreecommitdiff
path: root/navit/vehicle/gpsd/vehicle_gpsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/vehicle/gpsd/vehicle_gpsd.c')
-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 da17a6699..9dbc18aa4 100644
--- a/navit/vehicle/gpsd/vehicle_gpsd.c
+++ b/navit/vehicle/gpsd/vehicle_gpsd.c
@@ -238,6 +238,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);
@@ -314,10 +315,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);