Skip to content

Commit 00bc3b8

Browse files
authored
Harden put functions against misuse (#986)
1 parent c978627 commit 00bc3b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

strings/base_com_ptr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ WINRT_EXPORT namespace winrt
111111

112112
type** put() noexcept
113113
{
114-
WINRT_ASSERT(m_ptr == nullptr);
114+
release_ref();
115115
return &m_ptr;
116116
}
117117

strings/base_handle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ WINRT_EXPORT namespace winrt
5252

5353
type* put() noexcept
5454
{
55-
WINRT_ASSERT(m_value == T::invalid());
55+
close();
5656
return &m_value;
5757
}
5858

0 commit comments

Comments
 (0)