diff options
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(); |
