Skip to content

Support building cpprestsdk with /MT on Windows #884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Next Next commit
Remove _ASYNCRTIMP from ~http_listener() and implement inline
  • Loading branch information
ioannis-e committed Oct 2, 2018
commit f7432456fd1dd8a3e2dd92b5b51cfac231585ee7
11 changes: 10 additions & 1 deletion Release/include/cpprest/http_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,16 @@ class http_listener
/// Destructor frees any held resources.
/// </summary>
/// <remarks>Call close() before allowing a listener to be destroyed.</remarks>
_ASYNCRTIMP ~http_listener();
~http_listener() {
if (m_impl) {
// As a safe guard close the listener if not already done.
// Users are required to call close, but this is just a safeguard.
try {
m_impl->close().wait();
} catch (...) {
}
}
}

/// <summary>
/// Asynchronously open the listener, i.e. start accepting requests.
Expand Down
15 changes: 0 additions & 15 deletions Release/src/http/listener/http_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@ details::http_listener_impl::http_listener_impl(http::uri address, http_listener
check_listener_uri(m_uri);
}

http_listener::~http_listener()
{
if(m_impl)
{
// As a safe guard close the listener if not already done.
// Users are required to call close, but this is just a safeguard.
try
{
close().wait();
} catch(...)
{
}
}
}

pplx::task<void> details::http_listener_impl::open()
{
// Do nothing if the open operation was already attempted
Expand Down