diff options
author | deva <deva> | 2010-05-27 09:45:12 +0000 |
---|---|---|
committer | deva <deva> | 2010-05-27 09:45:12 +0000 |
commit | f92dd279a1e26dad7507d5d6944567c23834d440 (patch) | |
tree | 59dbd43d60937c6b3eaa82a36de8859a209e8163 /server/src/environment.cc | |
parent | 73934812611cc7120175e26761d71fae9233c1e8 (diff) |
A lot of session handling. A lot of new unit tests. Add of a more structured commit/discard handling. Fix of some wierd line break bugs in journalwriter
Diffstat (limited to 'server/src/environment.cc')
-rw-r--r-- | server/src/environment.cc | 26 |
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; |