From 374fd7c0cd4d2925d02c8a68d6014aea2b29133c Mon Sep 17 00:00:00 2001 From: Amir Shalem Date: Sun, 29 Jul 2018 14:02:27 -0700 Subject: [PATCH] Deallocate the YogaConfig memory with correct method Summary: We've mistakenly used `free()` to free the memory, where `delete` should have been used Reviewed By: davidaurelio Differential Revision: D9042347 fbshipit-source-id: e15cec0f498409066521a6de1e3fe4b7404ec46c --- ReactCommon/yoga/yoga/Yoga.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index b9a5f781e..a05ff8525 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -369,7 +369,7 @@ YGConfigRef YGConfigNew(void) { } void YGConfigFree(const YGConfigRef config) { - free(config); + delete config; gConfigInstanceCount--; }