Made JsonDocument's destructor protected (fixes #1480)

This commit is contained in:
Benoit Blanchon committed 2021-01-27 10:00:10 +01:00
1 parent 322d13de0d
commit c70a491f59
4 files changed
+22

No files matched your search

@@ -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)
@@ -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;
}