Skip to content

Commit b7e0d73

Browse files
committed
ResourceManager: decouple from VariantImpl
1 parent a3b10ed commit b7e0d73

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
@@ -548,6 +548,7 @@ class VariantImpl {
548548

549549
void freeVariant(Slot<VariantData> slot) {
550550
ARDUINOJSON_ASSERT(resources_ != nullptr);
551+
VariantImpl(slot.ptr(), resources_).clear();
551552
resources_->freeVariant(slot);
552553
}
553554

0 commit comments

Comments
 (0)