Skip to content

Commit 33a4c6a

Browse files
devyteearlephilhower
authored andcommitted
Update StreamHttpClient.ino (#6030)
Fix WiFiClient vs. HttpClient declaration order Fixes #6028
1 parent 13589b1 commit 33a4c6a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ void loop() {
3838
// wait for WiFi connection
3939
if ((WiFiMulti.run() == WL_CONNECTED)) {
4040

41-
HTTPClient http;
42-
4341
WiFiClient client;
42+
HTTPClient http; //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
4443

4544
Serial.print("[HTTP] begin...\n");
4645

0 commit comments

Comments
 (0)