forked from bblanchon/ArduinoJson
Made JsonDocument's destructor protected (fixes #1480)
This commit is contained in:
@ -1,6 +1,11 @@
|
|||||||
ArduinoJson: change log
|
ArduinoJson: change log
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
HEAD
|
||||||
|
----
|
||||||
|
|
||||||
|
* Made `JsonDocument`'s destructor protected (issue #1480)
|
||||||
|
|
||||||
v6.17.2 (2020-11-14)
|
v6.17.2 (2020-11-14)
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -36,3 +36,6 @@ build_should_fail(read_long_long)
|
|||||||
add_executable(write_long_long write_long_long.cpp)
|
add_executable(write_long_long write_long_long.cpp)
|
||||||
set_property(TARGET write_long_long PROPERTY CXX_STANDARD 11)
|
set_property(TARGET write_long_long PROPERTY CXX_STANDARD 11)
|
||||||
build_should_fail(write_long_long)
|
build_should_fail(write_long_long)
|
||||||
|
|
||||||
|
add_executable(delete_jsondocument delete_jsondocument.cpp)
|
||||||
|
build_should_fail(delete_jsondocument)
|
||||||
|
12
extras/tests/FailingBuilds/delete_jsondocument.cpp
Normal file
12
extras/tests/FailingBuilds/delete_jsondocument.cpp
Normal 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;
|
||||||
|
}
|
@ -310,6 +310,8 @@ class JsonDocument : public Visitable {
|
|||||||
_data.setNull();
|
_data.setNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~JsonDocument() {}
|
||||||
|
|
||||||
void replacePool(MemoryPool pool) {
|
void replacePool(MemoryPool pool) {
|
||||||
_pool = pool;
|
_pool = pool;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user