Skip to content

Commit ab6d3fe

Browse files
ioannis-eBillyONeal
authored andcommitted
Remove _ASYNCRTIMP from ~http_listener() and implement inline (#937)
1 parent bcccf54 commit ab6d3fe

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

Release/include/cpprest/http_listener.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,16 @@ class http_listener
270270
/// Destructor frees any held resources.
271271
/// </summary>
272272
/// <remarks>Call close() before allowing a listener to be destroyed.</remarks>
273-
_ASYNCRTIMP ~http_listener();
273+
~http_listener() {
274+
if (m_impl) {
275+
// As a safe guard close the listener if not already done.
276+
// Users are required to call close, but this is just a safeguard.
277+
try {
278+
m_impl->close().wait();
279+
} catch (...) {
280+
}
281+
}
282+
}
274283

275284
/// <summary>
276285
/// Asynchronously open the listener, i.e. start accepting requests.

Release/src/http/listener/http_listener.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,6 @@ details::http_listener_impl::http_listener_impl(http::uri address, http_listener
6363
check_listener_uri(m_uri);
6464
}
6565

66-
http_listener::~http_listener()
67-
{
68-
if(m_impl)
69-
{
70-
// As a safe guard close the listener if not already done.
71-
// Users are required to call close, but this is just a safeguard.
72-
try
73-
{
74-
close().wait();
75-
} catch(...)
76-
{
77-
}
78-
}
79-
}
80-
8166
pplx::task<void> details::http_listener_impl::open()
8267
{
8368
// Do nothing if the open operation was already attempted

0 commit comments

Comments
 (0)