Made JsonDocument's destructor protected (fixes #1480)

This commit is contained in:
Benoit Blanchon
2021-01-27 09:59:51 +01:00
parent 322d13de0d
commit c70a491f59
4 changed files with 22 additions and 0 deletions

View File

@ -36,3 +36,6 @@ build_should_fail(read_long_long)
add_executable(write_long_long write_long_long.cpp)
set_property(TARGET write_long_long PROPERTY CXX_STANDARD 11)
build_should_fail(write_long_long)
add_executable(delete_jsondocument delete_jsondocument.cpp)
build_should_fail(delete_jsondocument)

View File

@ -0,0 +1,12 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2021
// MIT License
#include <ArduinoJson.h>
struct Stream {};
int main() {
JsonDocument* doc = new DynamicJsonDocument(42);
delete doc;
}