This commit is contained in:
Lynix 2017-02-15 07:21:17 +01:00
commit c8d046158c
3 changed files with 17 additions and 2 deletions

View File

@ -158,11 +158,16 @@ namespace Ndk
}
m_systemBits.Clear();
UnregisterAllHandles();
// We properly destroy each component
for (std::size_t i = m_componentBits.FindFirst(); i != m_componentBits.npos; i = m_componentBits.FindNext(i))
m_components[i]->SetEntity(nullptr);
m_components.clear();
m_componentBits.Reset();
// And then free every handle
UnregisterAllHandles();
m_valid = false;
}

View File

@ -5102,10 +5102,14 @@ namespace Nz
*/
String String::FormatVA(const char* format, va_list args)
{
// Copy va_list to use it twice
va_list args2;
va_copy(args2, args);
std::size_t length = std::vsnprintf(nullptr, 0, format, args);
auto str = std::make_shared<SharedString>(length);
std::vsnprintf(str->string.get(), length + 1, format, args);
std::vsnprintf(str->string.get(), length + 1, format, args2);
return String(std::move(str));
}

View File

@ -17,6 +17,12 @@
namespace Nz
{
/*!
* \ingroup network
* \class Nz::UdpSocket
* \brief Network class that represents a UDP socket, allowing for sending/receiving datagrams.
*/
/*!
* \brief Binds a specific IpAddress
* \return State of the socket