From c060abe6a7ad2f3dc82f560afd4f9be126dd0728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 14 Sep 2017 20:19:19 +0200 Subject: [PATCH] Silenced valgrind warnings --- src/data.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/data.cpp b/src/data.cpp index ae43e942..93395e54 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -11,21 +11,30 @@ #include "data.h" +static GPXParser gpx; +static TCXParser tcx; +static KMLParser kml; +static FITParser fit; +static CSVParser csv; +static IGCParser igc; +static NMEAParser nmea; + static QHash parsers() { QHash hash; - hash.insert("gpx", new GPXParser()); - hash.insert("tcx", new TCXParser()); - hash.insert("kml", new KMLParser()); - hash.insert("fit", new FITParser()); - hash.insert("csv", new CSVParser()); - hash.insert("igc", new IGCParser()); - hash.insert("nmea", new NMEAParser()); + hash.insert("gpx", &gpx); + hash.insert("tcx", &tcx); + hash.insert("kml", &kml); + hash.insert("fit", &fit); + hash.insert("csv", &csv); + hash.insert("igc", &igc); + hash.insert("nmea", &nmea); return hash; } + QHash Data::_parsers = parsers(); Data::~Data()