Commit 9fd3b7b2 authored by Kevin Coulomb's avatar Kevin Coulomb
Browse files

Modification de destructeurs

parent a895761d
......@@ -2,6 +2,7 @@
*\file DrawTrace.hpp
*/
#ifndef DRAW_TRACE_HPP
#define DRAW_TRACE_HPP
......@@ -133,12 +134,11 @@ public:
}
/*!
* \brief The destructor
*/
virtual ~DrawTrace() {
}
......
......@@ -12,3 +12,11 @@ const map<std::string, Value *> *Entity::get_extra_fields() const {
return &_extra_fields;
}
Entity::~Entity(){
for(map<std::string, Value *>::iterator it = _extra_fields.begin();
it != _extra_fields.end();
it++){
delete (*it).second;
}
}
......@@ -42,6 +42,8 @@ public:
* \brief Get the extra fields
*/
const map<std::string, Value *> *get_extra_fields() const;
~Entity();
};
#include "Container.hpp"
......
......@@ -29,6 +29,12 @@ EntityType::~EntityType(){
delete _values.front();
_values.pop_front();
}
delete _container_type;
map<std::string , Value * >::iterator cur = _extra_fields.begin();
while((*cur).second){
delete (*cur).second;
cur++;
}
}
const map<std::string, Value *> *EntityType::get_extra_fields() const {
......
......@@ -16,3 +16,13 @@ const map<std::string, Value *> *EntityValue::get_extra_fields() const {
return &_opt;
}
EntityValue::~EntityValue(){
delete _type;
_type = NULL;
for(map<std::string, Value *>::iterator it = _opt.begin();
it != _opt.end();
it++){
delete (*it).second;
}
}
......@@ -50,6 +50,8 @@ public:
* \brief Get the extra fields
*/
const map<std::string, Value *> *get_extra_fields() const;
~EntityValue();
};
#endif
......@@ -52,6 +52,7 @@ public:
* \return Pointer to the Entityvalue or NULL if it has no value
*/
const EntityValue *get_value() const;
};
#endif
......
......@@ -33,3 +33,4 @@ const Container *Link::get_destination() const {
return _destination;
}
......@@ -72,7 +72,7 @@ public:
* \brief Get the destination container of the link
*/
const Container *get_destination() const;
};
#endif
......@@ -5,3 +5,9 @@ LinkType::LinkType(Name name, ContainerType *container_type, ContainerType *sour
}
LinkType::~LinkType(){
delete _source_type;
_source_type = NULL;
delete _destination_type;
_destination_type = NULL;
}
......@@ -31,6 +31,13 @@ public :
* \param opt optionnal data of the link
*/
LinkType(Name name, ContainerType *container_type, ContainerType *source_type, ContainerType *destination_type, map<std::string, Value *> opt);
/*!
* \fn ~LinkType()
* \brief Destructor
*/
~LinkType();
};
#endif
......@@ -33,3 +33,7 @@ const State *StateChange::get_right_state() const {
return _right;
}
StateChange::~StateChange(){
delete _right;
_right = NULL;
}
......@@ -21,6 +21,7 @@ public:
State *get_right_state();
const State *get_left_state() const;
const State *get_right_state() const;
~StateChange();
};
#endif
......
......@@ -18,6 +18,7 @@ Trace::~Trace() {
delete _root_container_types.front();
_root_container_types.pop_front();
}
}
static void delete_opt(map<std::string, Value *> &opt) {
......
......@@ -64,6 +64,7 @@ public:
* \brief Get the type of the variable
*/
const VariableType *get_type() const;
};
#endif
......
......@@ -93,6 +93,7 @@ public:
*/
~BinaryTree() {
delete _root;
_root = NULL;
}
/*!
......
......@@ -53,6 +53,10 @@ public:
if(_right_child)
delete _right_child;
delete _element;
_element = NULL;
_left_child = NULL;
_right_child = NULL;
_parent = NULL;
}
/*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment