This ensures actions in shared action maps are deleted as well
check_sub_loads(false)
{ }
-Loader::~Loader()
-{
- for(ActionMap::iterator i=local_actions.begin(); i!=local_actions.end(); ++i)
- delete i->second;
-}
-
void Loader::load(Parser &p)
{
if(!actions)
return cur_st->keyword;
}
+
+Loader::ActionMap::~ActionMap()
+{
+ for(iterator i=begin(); i!=end(); ++i)
+ delete i->second;
+}
+
} // namespace DataFile
} // namespace Msp
class Loader: private NonCopyable
{
protected:
- typedef std::map<StatementKey, LoaderAction *> ActionMap;
+ class ActionMap: public std::map<StatementKey, LoaderAction *>, private NonCopyable
+ {
+ public:
+ ~ActionMap();
+ };
private:
ActionMap local_actions;
Loader();
public:
- virtual ~Loader();
+ virtual ~Loader() { }
/** Loads statements from a parser. */
void load(Parser &p);