summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/application/main/include/AppContext.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/application/main/include/AppContext.hpp b/source/application/main/include/AppContext.hpp
index 10de126..13f2686 100644
--- a/source/application/main/include/AppContext.hpp
+++ b/source/application/main/include/AppContext.hpp
@@ -58,6 +58,12 @@ namespace app {
template<typename T>
void Set(const std::string &name, T object)
{
+ /* check if we have already the attribute allocated. */
+ if( true == this->Has(name) ){
+ //delete its value
+ delete this->m_attributes[name];
+ }
+ /* allocate new value */
this->m_attributes[name] = new Attribute<T>(object);
}