aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/command.cc6
-rw-r--r--common/command.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/common/command.cc b/common/command.cc
index f0d028ce..cad89c02 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -430,7 +430,6 @@ int CommandHandler::exec()
std::unique_ptr<Context> CommandHandler::load_json(std::string filename)
{
- vm.clear();
std::unordered_map<std::string, Property> values;
std::unique_ptr<Context> ctx = createContext(values);
setupContext(ctx.get());
@@ -444,6 +443,11 @@ std::unique_ptr<Context> CommandHandler::load_json(std::string filename)
return ctx;
}
+void CommandHandler::clear()
+{
+ vm.clear();
+}
+
void CommandHandler::run_script_hook(const std::string &name)
{
#ifndef NO_PYTHON
diff --git a/common/command.h b/common/command.h
index e52b5a48..36b6d8ab 100644
--- a/common/command.h
+++ b/common/command.h
@@ -38,6 +38,7 @@ class CommandHandler
int exec();
std::unique_ptr<Context> load_json(std::string filename);
+ void clear();
protected:
virtual void setupArchContext(Context *ctx) = 0;