summaryrefslogtreecommitdiff
path: root/server/src/environment.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/environment.cc')
-rw-r--r--server/src/environment.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/server/src/environment.cc b/server/src/environment.cc
index 14dbd79..9904afc 100644
--- a/server/src/environment.cc
+++ b/server/src/environment.cc
@@ -46,18 +46,26 @@ Environment::Environment()
Environment::~Environment()
{
-}
+ // Remove, but wait until resources are released
+ std::list<Database*> dblst = dbpool.clear(false);
+ std::list<Database*>::iterator i = dblst.begin();
+ while(i != dblst.end()) {
+ delete *i;
+ i++;
+ }
-/*
- TCPSocket pentominos_socket;
-#ifndef WITHOUT_PENTOMINOS
- pentominos_socket.connect(Conf::pentominos_addr, Conf::pentominos_port);
-#endif
-*/
+ // Remove, but wait until resources are released
+ std::list<Artefact*> atflst = atfpool.clear(false);
+ std::list<Artefact*>::iterator j = atflst.begin();
+ while(j != atflst.end()) {
+ delete *j;
+ j++;
+ }
+}
#ifdef TEST_ENVIRONMENT
//deps: configuration.cc database.cc artefact.cc pracrodao.cc session.cc mutex.cc semaphore.cc debug.cc pracrodaotest.cc pracrodaopgsql.cc journalwriter.cc journal_commit.cc entitylist.cc inotify.cc exception.cc versionstr.cc tcpsocket.cc macrolist.cc templatelist.cc saxparser.cc log.cc macroheaderparser.cc templateheaderparser.cc
-//cflags: -I.. $(PQXX_CXXFLAGS) $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS)
+//cflags: -DWITHOUT_ARTEFACT -I.. $(PQXX_CXXFLAGS) $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS)
//libs: $(PQXX_LIBS) -lpthread $(EXPAT_LIBS) $(PTHREAD_LIBS)
#include "test.h"
@@ -68,6 +76,8 @@ Conf::database_poolsize = 1;
Conf::artefact_poolsize = 1;
+Conf::xml_basedir = "/tmp";
+
TEST_NOEXCEPTION(Environment env, "Check if the Enviroment can be created.");
TEST_END;