aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/test/test.cpp
diff options
context:
space:
mode:
authorAleric Inglewood2010-11-10 15:19:13 +0100
committerAleric Inglewood2010-11-17 01:03:18 +0100
commitb66950bc26cfb3210e786c966141b20a5cc13a84 (patch)
tree5afd535bfd59f1fb1fc6d9132958965c527aa0ee /linden/indra/test/test.cpp
parentIMP-712: Add shortcut for the Groups tab. (diff)
downloadmeta-impy-b66950bc26cfb3210e786c966141b20a5cc13a84.zip
meta-impy-b66950bc26cfb3210e786c966141b20a5cc13a84.tar.gz
meta-impy-b66950bc26cfb3210e786c966141b20a5cc13a84.tar.bz2
meta-impy-b66950bc26cfb3210e786c966141b20a5cc13a84.tar.xz
IMP-590: Added a thread-safe and robust wrapper for APR pools.
See http://redmine.imprudenceviewer.org/issues/590
Diffstat (limited to '')
-rw-r--r--linden/indra/test/test.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/linden/indra/test/test.cpp b/linden/indra/test/test.cpp
index ba81c6e..b699f74 100644
--- a/linden/indra/test/test.cpp
+++ b/linden/indra/test/test.cpp
@@ -43,8 +43,8 @@
43#include "linden_common.h" 43#include "linden_common.h"
44#include "llerrorcontrol.h" 44#include "llerrorcontrol.h"
45#include "lltut.h" 45#include "lltut.h"
46#include "aiaprpool.h"
46 47
47#include "apr_pools.h"
48#include "apr_getopt.h" 48#include "apr_getopt.h"
49 49
50// the CTYPE_WORKAROUND is needed for linux dev stations that don't 50// the CTYPE_WORKAROUND is needed for linux dev stations that don't
@@ -248,17 +248,12 @@ int main(int argc, char **argv)
248 ctype_workaround(); 248 ctype_workaround();
249#endif 249#endif
250 250
251 apr_initialize(); 251 LLAPRPool pool;
252 apr_pool_t* pool = NULL; 252 pool.create();
253 if(APR_SUCCESS != apr_pool_create(&pool, NULL))
254 {
255 std::cerr << "Unable to initialize pool" << std::endl;
256 return 1;
257 }
258 apr_getopt_t* os = NULL; 253 apr_getopt_t* os = NULL;
259 if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv)) 254 if(APR_SUCCESS != apr_getopt_init(&os, pool(), argc, argv))
260 { 255 {
261 std::cerr << "Unable to pool" << std::endl; 256 std::cerr << "Unable to initialize the arguments for parsing by apr_getopt()." << std::endl;
262 return 1; 257 return 1;
263 } 258 }
264 259
@@ -360,6 +355,5 @@ int main(int argc, char **argv)
360 s.close(); 355 s.close();
361 } 356 }
362 357
363 apr_terminate();
364 return 0; 358 return 0;
365} 359}