Skip to content

Commit f7d444d

Browse files
committed
ResourceManager: decouple from VariantImpl
1 parent b9eb648 commit f7d444d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/ArduinoJson/Memory/ResourceManagerImpl.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include <ArduinoJson/Memory/ResourceManager.hpp>
88
#include <ArduinoJson/Polyfills/alias_cast.hpp>
9-
#include <ArduinoJson/Variant/VariantImpl.hpp>
109

1110
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
1211

@@ -21,7 +20,6 @@ inline Slot<VariantData> ResourceManager::allocVariant() {
2120
}
2221

2322
inline void ResourceManager::freeVariant(Slot<VariantData> slot) {
24-
VariantImpl(slot.ptr(), this).clear();
2523
variantPools_.freeSlot(slot);
2624
}
2725

src/ArduinoJson/Variant/VariantImpl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ class VariantImpl {
516516

517517
void freeVariant(Slot<VariantData> slot) {
518518
ARDUINOJSON_ASSERT(resources_ != nullptr);
519+
VariantImpl(slot.ptr(), resources_).clear();
519520
resources_->freeVariant(slot);
520521
}
521522

0 commit comments

Comments
 (0)