From d805e8d90b716db8beda166f090fc90cb57f827b Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Tue, 1 Nov 2005 11:38:19 +0000 Subject: [PATCH] apply new lifetime policy to avoid crash on exit in test/Factory git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@340 7ec92016-0320-0410-acc4-a06ded1c099a --- test/Factory/Factory.cpp | 25 ++++++++++++++++--------- test/Factory/Factory.dev | 2 +- test/Makefile | 5 ++--- test/Singleton/Dependencies.cpp | 6 ++---- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/test/Factory/Factory.cpp b/test/Factory/Factory.cpp index 0ec1b70..48d37be 100755 --- a/test/Factory/Factory.cpp +++ b/test/Factory/Factory.cpp @@ -23,12 +23,10 @@ #ifdef USE_SEQUENCE #include "loki/Sequence.h" -using Loki::Seq; + #endif -using Loki::Functor; -using Loki::Factory; -using Loki::SingletonHolder; +using namespace Loki; using std::cout; using std::endl; @@ -53,7 +51,9 @@ public: typedef SingletonHolder < - Factory< AbstractProduct, int > + Factory< AbstractProduct, int >, + CreateUsingNew, + FollowIntoDeath::AfterMaster::Impl::ObjAllocatorSingleton>::IsDestroyed > PFactoryNull; @@ -64,10 +64,12 @@ PFactoryNull; typedef SingletonHolder < #ifndef USE_SEQUENCE - Factory< AbstractProduct, int, LOKI_TYPELIST_2( int, int ) > + Factory< AbstractProduct, int, LOKI_TYPELIST_2( int, int ) >, #else - Factory< AbstractProduct, int, Seq< int, int > > + Factory< AbstractProduct, int, Seq< int, int > >, #endif + CreateUsingNew, + FollowIntoDeath::AfterMaster::Impl::ObjAllocatorSingleton>::IsDestroyed > PFactory; @@ -161,10 +163,12 @@ typedef SingletonHolder < #ifndef USE_SEQUENCE - Factory< AbstractProduct, int,LOKI_TYPELIST_3(CreateFunctor,int,int) > + Factory< AbstractProduct, int,LOKI_TYPELIST_3(CreateFunctor,int,int) >, #else - Factory< AbstractProduct, int,Seq > + Factory< AbstractProduct, int,Seq >, #endif + CreateUsingNew, + FollowIntoDeath::AfterMaster::Impl::ObjAllocatorSingleton>::IsDestroyed > PFactoryFunctorParm; @@ -249,6 +253,9 @@ int main(int argc, char *argv[]) } // $Log$ +// Revision 1.6 2005/11/01 11:38:19 syntheticpp +// apply new lifetime policy to avoid crash on exit in test/Factory +// // Revision 1.5 2005/10/30 14:03:23 syntheticpp // replace tabs space // diff --git a/test/Factory/Factory.dev b/test/Factory/Factory.dev index 852959a..6e57409 100755 --- a/test/Factory/Factory.dev +++ b/test/Factory/Factory.dev @@ -11,7 +11,7 @@ PrivateResource= ResourceIncludes= MakeIncludes= Compiler= -CppCompiler=-Wall -pedantic_@@_ +CppCompiler=-D DEBUG_@@_-D _DEBUG_@@_-Wall -pedantic_@@_ Linker= IsCpp=1 Icon= diff --git a/test/Makefile b/test/Makefile index 56e2c88..c826114 100755 --- a/test/Makefile +++ b/test/Makefile @@ -79,12 +79,11 @@ clean: cd SmallObj && \ $(MAKE) -f $(MAKEFILE) clean @cd .. - cd Singleton && \ - $(MAKE) -f $(MAKEFILE)-DeletableSingleton clean&& \ + $(MAKE) -f $(MAKEFILE)-DeletableSingleton clean && \ $(MAKE) -f $(MAKEFILE)-Phoenix clean && \ $(MAKE) -f $(MAKEFILE)-Dependencies clean - + @cd .. FORCE: diff --git a/test/Singleton/Dependencies.cpp b/test/Singleton/Dependencies.cpp index 1cf66cf..82cfcee 100755 --- a/test/Singleton/Dependencies.cpp +++ b/test/Singleton/Dependencies.cpp @@ -61,8 +61,7 @@ typedef SingletonHolder < MyFunctionObject, CreateUsingNew, - FollowIntoDeath::AfterMaster::Impl::ObjAllocatorSingleton - >::IsDestroyed + FollowIntoDeath::AfterMaster::Impl::ObjAllocatorSingleton>::IsDestroyed > Singleton_MyFunctionObject1; @@ -70,8 +69,7 @@ typedef SingletonHolder < MyFunctionObject, CreateUsingNew, - FollowIntoDeath::AfterMaster::Impl::ObjAllocatorSingleton - >::IsDestroyed + FollowIntoDeath::AfterMaster::Impl::ObjAllocatorSingleton>::IsDestroyed > Singleton_MyFunctionObject2;