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