minor fixes
This commit is contained in:
parent
50c499700a
commit
8da2166a1e
|
|
@ -34,6 +34,7 @@ uint32_t last_object_id = 0;
|
||||||
|
|
||||||
ObjectBase::ObjectBase()
|
ObjectBase::ObjectBase()
|
||||||
: tracing_leak_(false)
|
: tracing_leak_(false)
|
||||||
|
, name_(nullptr)
|
||||||
, user_data_()
|
, user_data_()
|
||||||
, id_(++last_object_id)
|
, id_(++last_object_id)
|
||||||
{
|
{
|
||||||
|
|
@ -44,7 +45,11 @@ ObjectBase::ObjectBase()
|
||||||
|
|
||||||
ObjectBase::~ObjectBase()
|
ObjectBase::~ObjectBase()
|
||||||
{
|
{
|
||||||
name_.reset();
|
if (name_)
|
||||||
|
{
|
||||||
|
delete name_;
|
||||||
|
name_ = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef KGE_DEBUG
|
#ifdef KGE_DEBUG
|
||||||
ObjectBase::RemoveObjectFromTracingList(this);
|
ObjectBase::RemoveObjectFromTracingList(this);
|
||||||
|
|
@ -75,7 +80,7 @@ void ObjectBase::SetName(const String& name)
|
||||||
|
|
||||||
if (!name_)
|
if (!name_)
|
||||||
{
|
{
|
||||||
name_ = std::make_unique<String>(name);
|
name_ = new String(name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,8 @@ private:
|
||||||
const uint32_t id_;
|
const uint32_t id_;
|
||||||
|
|
||||||
bool tracing_leak_;
|
bool tracing_leak_;
|
||||||
|
String* name_;
|
||||||
Any user_data_;
|
Any user_data_;
|
||||||
|
|
||||||
std::unique_ptr<String> name_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline String ObjectBase::GetName() const
|
inline String ObjectBase::GetName() const
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#if defined(KGE_PLATFORM_WINDOWS)
|
#if defined(KGE_PLATFORM_WINDOWS)
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <kiwano/core/Keys.h>
|
#include <kiwano/core/Keys.h>
|
||||||
#include <kiwano/core/Exception.h>
|
#include <kiwano/core/Exception.h>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue