diff --git a/strings/base_array.h b/strings/base_array.h index 5f0904efe..5d1bee3c5 100644 --- a/strings/base_array.h +++ b/strings/base_array.h @@ -420,7 +420,10 @@ WINRT_EXPORT namespace winrt template auto detach_abi(com_array& object) noexcept { - std::pair> result(object.size(), *reinterpret_cast*>(&object)); + std::pair> result; + memset(&result, 0, sizeof(result)); + result.first = object.size(); + result.second = *reinterpret_cast*>(&object); memset(&object, 0, sizeof(com_array)); return result; }