diff options
-rw-r--r-- | project2/cgi/cgiProgRouter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/project2/cgi/cgiProgRouter.cpp b/project2/cgi/cgiProgRouter.cpp index ff7c864..6e7f73f 100644 --- a/project2/cgi/cgiProgRouter.cpp +++ b/project2/cgi/cgiProgRouter.cpp @@ -9,9 +9,9 @@ typedef std::map<std::string, std::string> VarMap; class RoutingTable { public: RoutingTable & operator=(const std::string & routeFile) { - routes.clear(); routeScriptPath = routeFile; if (routeFile.empty()) { + routes.clear(); routeScript.reset(); } else { @@ -30,6 +30,7 @@ class RoutingTable { { routeScript = Environment::getCurrent()->resolveScript(Environment::getCurrent()->datasourceRoot, routeScriptPath, true); routeScript->loader.addLoadTarget(routeScript->root(), Storer::into<ElementLoader>(&routes)); + routes.clear(); routeScript->load(NULL, true); } ScriptReaderPtr routeScript; |