Global destructor clean-ups and python test fixes
[invirt/third/libt4.git] / lock_tester.cc
index 7143401..58e691f 100644 (file)
@@ -5,13 +5,14 @@
 #include "lock_client.h"
 #include <arpa/inet.h>
 #include <unistd.h>
+#include "handle.h"
 
 char log_thread_prefix = 'c';
 
 // must be >= 2
 const int nt = 6; //XXX: lab1's rpc handlers are blocking. Since rpcs uses a thread pool of 10 threads, we cannot test more than 10 blocking rpc.
 static string dst;
-static lock_client **lc = new lock_client * [nt];
+static lock_client *lc[nt];
 static lock_protocol::lockid_t a = "1";
 static lock_protocol::lockid_t b = "2";
 static lock_protocol::lockid_t c = "3";
@@ -180,4 +181,11 @@ main(int argc, char *argv[])
 
     LOG_NONMEMBER << argv[0] << ": passed all tests successfully";
 
+    for (int i = 0; i < nt; i++)
+        delete lc[i];
+
+    handle::shutdown();
+    poll_mgr::shared_mgr.shutdown();
+
+    LOG_NONMEMBER << argv[0] << ": clean-up complete";
 }