]> git.street.me.uk Git - andy/viking.git/blobdiff - test/gpx2gpx.c
Fix crash if a route requested by the route finder is empty.
[andy/viking.git] / test / gpx2gpx.c
index 0afbb0d253e30337e769df50bd1733db6c714198..e9a6b8aa9d7e8b6334915862118c31462ecff14f 100644 (file)
@@ -1,11 +1,17 @@
 #include <stdio.h>
 #include <gpx.h>
+#include <viklayer.h>
 
 int main(int argc, char *argv[])
 {
-  VikTrwLayer *trw = NULL;
-  gtk_init (&argc, &argv);
-  trw = vik_trw_layer_new(0);
+#if !GLIB_CHECK_VERSION (2, 36, 0)
+  g_type_init();
+#endif
+  VikLayer *vl = vik_layer_create (VIK_LAYER_TRW, NULL, FALSE);
+  VikTrwLayer *trw = VIK_TRW_LAYER (vl);
   a_gpx_read_file(trw, stdin);
-  a_gpx_write_file(trw, stdout);
+  a_gpx_write_file(trw, stdout, NULL);
+  // NB no layer_free functions directly visible anymore
+  //  automatically called by layers_panel_finalize cleanup in full Viking program
+  return 0;
 }