diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-03-30 12:43:46 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-03-30 12:43:46 +0300 |
| commit | c0e1d45695a918796ad34118596f345098ec39b9 (patch) | |
| tree | 80dd5b0b3d795957a33452f5f406ac5049510436 /protocols/Weather/src | |
| parent | 7d95e67308ee0abcce5c7bd66265146d3dfefd74 (diff) | |
code cleaning
Diffstat (limited to 'protocols/Weather/src')
| -rw-r--r-- | protocols/Weather/src/stdafx.h | 9 | ||||
| -rw-r--r-- | protocols/Weather/src/weather_addstn.cpp | 2 | ||||
| -rw-r--r-- | protocols/Weather/src/weather_update.cpp | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h index 96e5410c71..eec03bd13e 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -113,6 +113,15 @@ enum EWeatherCondition #define SM_WEATHERALERT 16
#define WM_UPDATEDATA (WM_USER + 2687)
+struct WeatherReply : public JsonReply
+{
+ WeatherReply(MHttpResponse *response) :
+ JsonReply(response)
+ {
+ delete response;
+ }
+};
+
/////////////////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
diff --git a/protocols/Weather/src/weather_addstn.cpp b/protocols/Weather/src/weather_addstn.cpp index 90c60ab68b..1bdfb9b49d 100644 --- a/protocols/Weather/src/weather_addstn.cpp +++ b/protocols/Weather/src/weather_addstn.cpp @@ -204,7 +204,7 @@ HANDLE CWeatherProto::SearchAdvanced(MWindow hwndOwner) int CWeatherProto::IDSearch(wchar_t *sID, int searchId) { - JsonReply reply(RunQuery(sID, 0)); + WeatherReply reply(RunQuery(sID, 0)); if (reply) { auto &data = reply.data(); CMStringW id(FORMAT, L"%lf, %lf", data["latitude"].as_float(), data["longitude"].as_float()); diff --git a/protocols/Weather/src/weather_update.cpp b/protocols/Weather/src/weather_update.cpp index d3a3fdfb90..15713e110e 100644 --- a/protocols/Weather/src/weather_update.cpp +++ b/protocols/Weather/src/weather_update.cpp @@ -411,7 +411,7 @@ int CWeatherProto::GetWeatherData(MCONTACT hContact) uint16_t cond = NA; // download the html file from the internet - JsonReply reply(RunQuery(id, 7)); + WeatherReply reply(RunQuery(id, 7)); if (!reply) return reply.error(); |
