summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2013-05-10 20:40:59 +0000
committerSteve Huston <shuston@riverace.com>2013-05-10 20:40:59 +0000
commit3905f3f6c9e47a00fd7a2ad1d55cd1a6214ce0f4 (patch)
tree2511da81b59c7b9b8d1ead4e0fc628101d13b9a0
parent63f0c20999064c4762c15f04d6245a0f0c699bf5 (diff)
downloadATCD-3905f3f6c9e47a00fd7a2ad1d55cd1a6214ce0f4.tar.gz
ChangeLogTag:Fri May 10 20:36:13 UTC 2013 Steve Huston <shuston@riverace.com>
-rw-r--r--ACE/ChangeLog12
-rw-r--r--ACE/THANKS1
-rw-r--r--ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp2
-rw-r--r--ACE/tests/Unbounded_Set_Test.cpp14
4 files changed, 28 insertions, 1 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 70adcdd129c..70f0c60f0ed 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,15 @@
+Fri May 10 20:36:13 UTC 2013 Steve Huston <shuston@riverace.com>
+
+ * examples/C++NPv2/AIO_Client_Logging_Daemon.cpp: Advance the
+ iterator whiel freeing items in close() to avoid an infinite
+ loop. Thanks to George Chen for finding this problem.
+
+ * tests/Unbounded_Set_Test.cpp: Added a allocate/iterate/free cycle
+ similar to the one above to catch this type of thing if it pops
+ up again.
+
+ * THANKS: Added George Chen.
+
Fri May 10 08:59:43 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Compiler_Features_17_Test.cpp:
diff --git a/ACE/THANKS b/ACE/THANKS
index b9ac37833d2..cb796a3759a 100644
--- a/ACE/THANKS
+++ b/ACE/THANKS
@@ -2380,6 +2380,7 @@ Rudy Pot <rpot at aweta dot nl>
Neil Youngman <ny at youngman dot org dot uk>
Andreas Florath <andreas at florath dot org>
Clyde Gerber <clyde_gerber at symantec dot com>
+George Chen <ace dot gc dot pthzfoldr at gmail dot com>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson in the early 1990's. Paul devised the recursive Makefile
diff --git a/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp b/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp
index cae69fc084b..32f4a54264b 100644
--- a/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp
+++ b/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp
@@ -198,7 +198,7 @@ void AIO_CLD_Acceptor::close (void) {
ACE_Unbounded_Set_Iterator<AIO_Input_Handler *>
iter (clients_.begin ());
AIO_Input_Handler **ih;
- while (iter.next (ih))
+ for (; iter.next (ih); ++iter)
delete *ih;
}
diff --git a/ACE/tests/Unbounded_Set_Test.cpp b/ACE/tests/Unbounded_Set_Test.cpp
index 8eb4340e316..cb2c494262f 100644
--- a/ACE/tests/Unbounded_Set_Test.cpp
+++ b/ACE/tests/Unbounded_Set_Test.cpp
@@ -212,6 +212,20 @@ run_main (int, ACE_TCHAR *[])
retval = -1;
}
+ // Test iterating through a set and deleting elements.
+ {
+ ACE_Unbounded_Set<MyNode*> ubs3;
+ MyNode *n = 0;
+ for (int i = 0; i < 10; ++i)
+ {
+ n = new MyNode (i);
+ ubs3.insert (n);
+ }
+ MyNode **i_n = 0;
+ ACE_Unbounded_Set_Iterator<MyNode*> ubs3_iter (ubs3.begin ());
+ for (; ubs3_iter.next (i_n); ++ubs3_iter)
+ delete *i_n;
+ }
ACE_END_TEST;
return retval;
}