aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-04-09 14:03:13 +0000
committerlloyd <[email protected]>2010-04-09 14:03:13 +0000
commit143b5cb297a36b94c9d0e56e2d2145a7c55efde5 (patch)
tree000b11f87806678649e68e753aaad8ed6ef45803 /src/libstate
parenta1fc16d73b6e8fbb041c5163687bfd37c5705da4 (diff)
parentd7e2e9316a5540e93595b5386f67594135de736d (diff)
propagate from branch 'net.randombit.botan' (head 75d272c759511a9a99a371ddc74bd17b2c1453b6)
to branch 'net.randombit.botan.c++0x' (head 2ce9ba37cb9287a3d875921240d6682100625b9f)
Diffstat (limited to 'src/libstate')
-rw-r--r--src/libstate/libstate.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/libstate/libstate.cpp b/src/libstate/libstate.cpp
index 943a7c2e6..e37617c94 100644
--- a/src/libstate/libstate.cpp
+++ b/src/libstate/libstate.cpp
@@ -237,36 +237,33 @@ void Library_State::initialize()
load_default_config();
- std::vector<Engine*> engines = {
+ m_algorithm_factory = new Algorithm_Factory(*mutex_factory);
#if defined(BOTAN_HAS_ENGINE_GNU_MP)
- new GMP_Engine,
+ algorithm_factory().add_engine(new GMP_Engine);
#endif
#if defined(BOTAN_HAS_ENGINE_OPENSSL)
- new OpenSSL_Engine,
+ algorithm_factory().add_engine(new OpenSSL_Engine);
#endif
#if defined(BOTAN_HAS_ENGINE_AES_ISA)
- new AES_ISA_Engine,
+ algorithm_factory().add_engine(new AES_ISA_Engine);
#endif
#if defined(BOTAN_HAS_ENGINE_SIMD)
- new SIMD_Engine,
+ algorithm_factory().add_engine(new SIMD_Engine);
#endif
#if defined(BOTAN_HAS_ENGINE_AMD64_ASSEMBLER)
- new AMD64_Assembler_Engine,
+ algorithm_factory().add_engine(new AMD64_Assembler_Engine);
#endif
#if defined(BOTAN_HAS_ENGINE_IA32_ASSEMBLER)
- new IA32_Assembler_Engine,
+ algorithm_factory().add_engine(new IA32_Assembler_Engine);
#endif
- new Default_Engine
- };
-
- m_algorithm_factory = new Algorithm_Factory(engines);
+ algorithm_factory().add_engine(new Default_Engine);
#if defined(BOTAN_HAS_SELFTESTS)
confirm_startup_self_tests(algorithm_factory());
@@ -280,6 +277,8 @@ Library_State::Library_State()
{
cached_default_allocator = 0;
m_algorithm_factory = 0;
+
+ global_rng_ptr = 0;
}
/*
@@ -290,6 +289,10 @@ Library_State::~Library_State()
delete m_algorithm_factory;
m_algorithm_factory = 0;
+ delete global_rng_ptr;
+ global_rng_ptr = 0;
+
+
cached_default_allocator = 0;
for(u32bit j = 0; j != allocators.size(); ++j)