Fix memory leak in NSJSONSerialization
@@ -102,7 +102,7 @@ id _WDJJsonObjectToNSJSON(const ComPtr<IJsonObject>& object, NSError** error) {
ComPtr<IMap<HSTRING, IJsonValue*>> map;
THROW_NS_IF_FAILED(object.As(&map));
- NSMutableDictionary* ret = [NSMutableDictionary new];
+ NSMutableDictionary* ret = [NSMutableDictionary dictionary];
// clang-format off
HRESULT hr = WRLHelpers::ForEach(
@@ -139,7 +139,7 @@ id _WDJJsonObjectToNSJSON(const ComPtr<IJsonObject>& object, NSError** error) {
// Copies ComPtr<IJsonArray> (an array of WDJJsonValue*) to NSMutableArray
id _WDJJsonArrayToNSJSON(const ComPtr<IJsonArray>& array, NSError** error) {
- NSMutableArray* ret = [NSMutableArray new];
+ NSMutableArray* ret = [NSMutableArray array];
ComPtr<IVector<IJsonValue*>> vector;
THROW_NS_IF_FAILED(array.As(&vector));
