From f92dd279a1e26dad7507d5d6944567c23834d440 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 27 May 2010 09:45:12 +0000 Subject: 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 --- server/src/environment.cc | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'server/src/environment.cc') 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 dblst = dbpool.clear(false); + std::list::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 atflst = atfpool.clear(false); + std::list::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; -- cgit v1.2.3