Added copy constructor to LocalizedString so that a LocalizedString created by copying another does not crash in the destructor.

This commit is contained in:
Kyzentun Keeslala
2015-12-27 06:45:49 -07:00
parent b8929e7c24
commit 55bd774a4c
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -45,6 +45,17 @@ LocalizedString::LocalizedString( const RString& sGroup, const RString& sName )
CreateImpl();
}
LocalizedString::LocalizedString(LocalizedString const& other)
{
m_Subscribers.Subscribe(this);
m_sGroup = other.m_sGroup;
m_sName = other.m_sName;
m_pImpl = NULL;
CreateImpl();
}
LocalizedString::~LocalizedString()
{
m_Subscribers.Unsubscribe( this );
+1
View File
@@ -13,6 +13,7 @@ class LocalizedString
{
public:
LocalizedString( const RString& sGroup = "", const RString& sName = "" );
LocalizedString(LocalizedString const& other);
~LocalizedString();
void Load( const RString& sGroup, const RString& sName );
operator const RString &() const { return GetValue(); }