Don't call config->setLogger(nullptr) directly to avoid having no logger at all

Summary:
Changelog: [Internal][Yoga] Don't call config->setLogger(nullptr) directly to avoid having no logger at all

Broken in D14151037 (05f36a835a) when it started calling
```
config->setLogger(nullptr);
```
instead of going thru
```
YGConfigSetLogger(config, nullptr);
```
which does the right thing by setting the logger to its default value:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/yoga/yoga/Yoga.cpp?commit=835911317e8b3cf7da1866e40e1c79cda0690136&lines=4320-4330

Also by default YogaConfig always have a logger:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/yoga/yoga/Yoga.cpp?commit=835911317e8b3cf7da1866e40e1c79cda0690136&lines=335-343

Reviewed By: SidharthGuglani

Differential Revision: D22387459

fbshipit-source-id: 4da91da87a696d38cc9d8db2acb5845d29398adb
This commit is contained in:
Amir Shalem
2020-07-06 03:41:19 -07:00
committed by Facebook GitHub Bot
parent d74a1069a0
commit a93e5d63c9
2 changed files with 53 additions and 1 deletions

View File

@@ -196,7 +196,7 @@ static void jni_YGConfigSetLoggerJNI(
delete context;
YGConfigSetContext(config, nullptr);
}
config->setLogger(nullptr);
YGConfigSetLogger(config, nullptr);
}
}