forked from premiere/premiere-libtorrent
merged fix from RC_0_16
This commit is contained in:
parent
75e0a21e95
commit
32b4b5926a
|
@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <vector>
|
||||
#include <set>
|
||||
#include <list>
|
||||
#include <stdarg.h> // for va_start, va_end
|
||||
|
||||
#ifndef TORRENT_DISABLE_GEO_IP
|
||||
#ifdef WITH_SHIPPED_GEOIP_H
|
||||
|
|
|
@ -387,17 +387,8 @@ namespace libtorrent
|
|||
struct TORRENT_EXPORT libtorrent_exception: std::exception
|
||||
{
|
||||
libtorrent_exception(error_code const& s): m_error(s), m_msg(0) {}
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
if (!m_msg)
|
||||
{
|
||||
std::string msg = m_error.message();
|
||||
m_msg = allocate_string_copy(msg.c_str());
|
||||
}
|
||||
|
||||
return m_msg;
|
||||
}
|
||||
virtual ~libtorrent_exception() throw() { free(m_msg); }
|
||||
virtual const char* what() const throw();
|
||||
virtual ~libtorrent_exception() throw();
|
||||
error_code error() const { return m_error; }
|
||||
private:
|
||||
error_code m_error;
|
||||
|
|
|
@ -298,5 +298,23 @@ namespace libtorrent
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
const char* libtorrent_exception::what() const throw()
|
||||
{
|
||||
if (!m_msg)
|
||||
{
|
||||
std::string msg = m_error.message();
|
||||
m_msg = allocate_string_copy(msg.c_str());
|
||||
}
|
||||
|
||||
return m_msg;
|
||||
}
|
||||
|
||||
libtorrent_exception::~libtorrent_exception() throw()
|
||||
{
|
||||
free(m_msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue