Merge branch 'master' of https://git.mimbach49.de/GerhardHoffmann/MOBILISIS-Calculator
This commit is contained in:
commit
eebb6d926e
@ -35,6 +35,8 @@ CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char cons
|
||||
qCritical() << " ... zone = " << zone;
|
||||
|
||||
if (zone <= 0) {
|
||||
delete *tariff;
|
||||
*tariff = nullptr;
|
||||
return calcState.set(CalcState::State::ERROR_PARSING_ZONE_NR);
|
||||
}
|
||||
|
||||
@ -59,9 +61,13 @@ CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char cons
|
||||
|
||||
QString json = fname.readAll();
|
||||
if (! (*tariff)->ParseJson(*tariff, json.toStdString().c_str())) {
|
||||
delete *tariff;
|
||||
*tariff = nullptr;
|
||||
return calcState.set(CalcState::State::ERROR_PARSING_TARIFF);
|
||||
}
|
||||
} else {
|
||||
delete *tariff;
|
||||
*tariff = nullptr;
|
||||
return calcState.set(CalcState::State::ERROR_LOADING_TARIFF);
|
||||
}
|
||||
|
||||
@ -71,7 +77,9 @@ CalcState CALCULATE_LIBRARY_API init_tariff(parking_tariff_t **tariff, char cons
|
||||
}
|
||||
|
||||
void CALCULATE_LIBRARY_API free_tariff(parking_tariff_t *tariff) {
|
||||
delete tariff;
|
||||
if (tariff != nullptr) {
|
||||
delete tariff;
|
||||
}
|
||||
}
|
||||
|
||||
CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
|
||||
|
Loading…
Reference in New Issue
Block a user