b64251c
diff -up ClanLib-0.6.5/Sources/API/Signals/signal_v0.h~ ClanLib-0.6.5/Sources/API/Signals/signal_v0.h
b64251c
--- ClanLib-0.6.5/Sources/API/Signals/signal_v0.h~	2002-06-13 16:43:17.000000000 +0200
b64251c
+++ ClanLib-0.6.5/Sources/API/Signals/signal_v0.h	2009-11-29 23:30:39.000000000 +0100
b64251c
@@ -62,33 +62,23 @@ public:
b64251c
 	//: Call
b64251c
 	void call()
b64251c
 	{
b64251c
-		std::list<SlotIterator> remove_slots;
b64251c
-
b64251c
 		// call slots connected to signal:
b64251c
 		CL_SlotParent_v0 super(slots.begin(), slots.end());
b64251c
 		super();
b64251c
 
b64251c
 		// find slots to be removed:
b64251c
-		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); slot_it++)
b64251c
+		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); )
b64251c
 		{
b64251c
 			Slot slot = *slot_it;
b64251c
 
b64251c
-			// skip slot if it has no more references left in application.
b64251c
-			// (make it pending for removal)
b64251c
+			// remove slot if it has no more references left in application.
b64251c
 			if (slot->get_slot_ref() == 0)
b64251c
 			{
b64251c
-				remove_slots.push_back(slot_it);
b64251c
-				continue;
b64251c
+				slot->release_signal_ref();
b64251c
+				slot_it = slots.erase(slot_it);
b64251c
 			}
b64251c
-		}
b64251c
-
b64251c
-		// remove all slots no longer connected to any CL_Slot.
b64251c
-		std::list<SlotIterator>::iterator remove_it;
b64251c
-		for (remove_it = remove_slots.begin(); remove_it != remove_slots.end(); remove_it++)
b64251c
-		{
b64251c
-			Slot slot = **remove_it;
b64251c
-			slot->release_signal_ref();
b64251c
-			slots.erase(*remove_it);
b64251c
+			else
b64251c
+				slot_it++;
b64251c
 		}
b64251c
 	}
b64251c
 
b64251c
diff -up ClanLib-0.6.5/Sources/API/Signals/signal_v1.h~ ClanLib-0.6.5/Sources/API/Signals/signal_v1.h
b64251c
--- ClanLib-0.6.5/Sources/API/Signals/signal_v1.h~	2002-06-13 16:43:17.000000000 +0200
b64251c
+++ ClanLib-0.6.5/Sources/API/Signals/signal_v1.h	2009-11-29 23:24:20.000000000 +0100
b64251c
@@ -63,31 +63,22 @@ public:
b64251c
 	//: Call
b64251c
 	void call(PARAM1 param1)
b64251c
 	{
b64251c
-		std::list<SlotIterator> remove_slots;
b64251c
-
b64251c
 		// call slots connected to signal:
b64251c
-		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); slot_it++)
b64251c
+		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); )
b64251c
 		{
b64251c
 			Slot slot = *slot_it;
b64251c
 
b64251c
-			// skip slot if it has no more references left in application.
b64251c
-			// (make it pending for removal)
b64251c
+			// remove slot if it has no more references left in application.
b64251c
 			if (slot->get_slot_ref() == 0)
b64251c
 			{
b64251c
-				remove_slots.push_back(slot_it);
b64251c
-				continue;
b64251c
+				slot->release_signal_ref();
b64251c
+				slot_it = slots.erase(slot_it);
b64251c
+			}
b64251c
+			else
b64251c
+			{
b64251c
+				slot->call(param1);
b64251c
+				slot_it++;
b64251c
 			}
b64251c
-			
b64251c
-			slot->call(param1);
b64251c
-		}
b64251c
-
b64251c
-		// remove all slots no longer connected to any CL_Slot.
b64251c
-		typename std::list<SlotIterator>::iterator remove_it;
b64251c
-		for (remove_it = remove_slots.begin(); remove_it != remove_slots.end(); remove_it++)
b64251c
-		{
b64251c
-			Slot slot = **remove_it;
b64251c
-			slot->release_signal_ref();
b64251c
-			slots.erase(*remove_it);
b64251c
 		}
b64251c
 	}
b64251c
 
b64251c
diff -up ClanLib-0.6.5/Sources/API/Signals/signal_v2.h~ ClanLib-0.6.5/Sources/API/Signals/signal_v2.h
b64251c
--- ClanLib-0.6.5/Sources/API/Signals/signal_v2.h~	2002-06-13 16:43:17.000000000 +0200
b64251c
+++ ClanLib-0.6.5/Sources/API/Signals/signal_v2.h	2009-11-29 23:29:03.000000000 +0100
b64251c
@@ -63,31 +63,22 @@ public:
b64251c
 	//: Call
b64251c
 	void call(PARAM1 param1, PARAM2 param2)
b64251c
 	{
b64251c
-		std::list<SlotIterator> remove_slots;
b64251c
-
b64251c
 		// call slots connected to signal:
b64251c
-		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); slot_it++)
b64251c
+		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); )
b64251c
 		{
b64251c
 			Slot slot = *slot_it;
b64251c
 
b64251c
-			// skip slot if it has no more references left in application.
b64251c
-			// (make it pending for removal)
b64251c
+			// remove slot if it has no more references left in application.
b64251c
 			if (slot->get_slot_ref() == 0)
b64251c
 			{
b64251c
-				remove_slots.push_back(slot_it);
b64251c
-				continue;
b64251c
+				slot->release_signal_ref();
b64251c
+				slot_it = slots.erase(slot_it);
b64251c
+			}
b64251c
+			else
b64251c
+			{
b64251c
+				slot->call(param1, param2);
b64251c
+				slot_it++;
b64251c
 			}
b64251c
-			
b64251c
-			slot->call(param1, param2);
b64251c
-		}
b64251c
-
b64251c
-		// remove all slots no longer connected to any CL_Slot.
b64251c
-		typename std::list<SlotIterator>::iterator remove_it;
b64251c
-		for (remove_it = remove_slots.begin(); remove_it != remove_slots.end(); remove_it++)
b64251c
-		{
b64251c
-			Slot slot = **remove_it;
b64251c
-			slot->release_signal_ref();
b64251c
-			slots.erase(*remove_it);
b64251c
 		}
b64251c
 	}
b64251c
 
b64251c
diff -up ClanLib-0.6.5/Sources/API/Signals/signal_v3.h~ ClanLib-0.6.5/Sources/API/Signals/signal_v3.h
b64251c
--- ClanLib-0.6.5/Sources/API/Signals/signal_v3.h~	2002-06-13 16:43:17.000000000 +0200
b64251c
+++ ClanLib-0.6.5/Sources/API/Signals/signal_v3.h	2009-11-29 23:25:00.000000000 +0100
b64251c
@@ -63,31 +63,22 @@ public:
b64251c
 	//: Call
b64251c
 	void call(PARAM1 param1, PARAM2 param2, PARAM3 param3)
b64251c
 	{
b64251c
-		std::list<SlotIterator> remove_slots;
b64251c
-
b64251c
 		// call slots connected to signal:
b64251c
-		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); slot_it++)
b64251c
+		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); )
b64251c
 		{
b64251c
 			Slot slot = *slot_it;
b64251c
 
b64251c
-			// skip slot if it has no more references left in application.
b64251c
-			// (make it pending for removal)
b64251c
+			// remove slot if it has no more references left in application.
b64251c
 			if (slot->get_slot_ref() == 0)
b64251c
 			{
b64251c
-				remove_slots.push_back(slot_it);
b64251c
-				continue;
b64251c
+				slot->release_signal_ref();
b64251c
+				slot_it = slots.erase(slot_it);
b64251c
+			}
b64251c
+			else
b64251c
+			{
b64251c
+				slot->call(param1, param2, param3);
b64251c
+				slot_it++;
b64251c
 			}
b64251c
-			
b64251c
-			slot->call(param1, param2, param3);
b64251c
-		}
b64251c
-
b64251c
-		// remove all slots no longer connected to any CL_Slot.
b64251c
-		typename std::list<SlotIterator>::iterator remove_it;
b64251c
-		for (remove_it = remove_slots.begin(); remove_it != remove_slots.end(); remove_it++)
b64251c
-		{
b64251c
-			Slot slot = **remove_it;
b64251c
-			slot->release_signal_ref();
b64251c
-			slots.erase(*remove_it);
b64251c
 		}
b64251c
 	}
b64251c
 
b64251c
diff -up ClanLib-0.6.5/Sources/API/Signals/signal_v4.h~ ClanLib-0.6.5/Sources/API/Signals/signal_v4.h
b64251c
--- ClanLib-0.6.5/Sources/API/Signals/signal_v4.h~	2002-06-13 16:43:17.000000000 +0200
b64251c
+++ ClanLib-0.6.5/Sources/API/Signals/signal_v4.h	2009-11-29 23:23:14.000000000 +0100
b64251c
@@ -63,31 +63,22 @@ public:
b64251c
 	//: Call
b64251c
 	void call(PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4)
b64251c
 	{
b64251c
-		std::list<SlotIterator> remove_slots;
b64251c
-
b64251c
 		// call slots connected to signal:
b64251c
-		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); slot_it++)
b64251c
+		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); )
b64251c
 		{
b64251c
 			Slot slot = *slot_it;
b64251c
 
b64251c
-			// skip slot if it has no more references left in application.
b64251c
-			// (make it pending for removal)
b64251c
+			// remove slot if it has no more references left in application.
b64251c
 			if (slot->get_slot_ref() == 0)
b64251c
 			{
b64251c
-				remove_slots.push_back(slot_it);
b64251c
-				continue;
b64251c
+				slot->release_signal_ref();
b64251c
+				slot_it = slots.erase(slot_it);
b64251c
+			}
b64251c
+			else
b64251c
+			{
b64251c
+				slot->call(param1, param2, param3, param4);
b64251c
+				slot_it++;
b64251c
 			}
b64251c
-			
b64251c
-			slot->call(param1, param2, param3, param4);
b64251c
-		}
b64251c
-
b64251c
-		// remove all slots no longer connected to any CL_Slot.
b64251c
-		typename std::list<SlotIterator>::iterator remove_it;
b64251c
-		for (remove_it = remove_slots.begin(); remove_it != remove_slots.end(); remove_it++)
b64251c
-		{
b64251c
-			Slot slot = **remove_it;
b64251c
-			slot->release_signal_ref();
b64251c
-			slots.erase(*remove_it);
b64251c
 		}
b64251c
 	}
b64251c
 
b64251c
diff -up ClanLib-0.6.5/Sources/API/Signals/signal_v5.h~ ClanLib-0.6.5/Sources/API/Signals/signal_v5.h
b64251c
--- ClanLib-0.6.5/Sources/API/Signals/signal_v5.h~	2002-06-13 16:43:17.000000000 +0200
b64251c
+++ ClanLib-0.6.5/Sources/API/Signals/signal_v5.h	2009-11-29 23:16:15.000000000 +0100
b64251c
@@ -63,31 +63,22 @@ public:
b64251c
 	//: Call
b64251c
 	void call(PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5)
b64251c
 	{
b64251c
-		std::list<SlotIterator> remove_slots;
b64251c
-
b64251c
 		// call slots connected to signal:
b64251c
-		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); slot_it++)
b64251c
+		for (SlotIterator slot_it = slots.begin(); slot_it != slots.end(); )
b64251c
 		{
b64251c
 			Slot slot = *slot_it;
b64251c
 
b64251c
-			// skip slot if it has no more references left in application.
b64251c
-			// (make it pending for removal)
b64251c
+			// remove slot if it has no more references left in application.
b64251c
 			if (slot->get_slot_ref() == 0)
b64251c
 			{
b64251c
-				remove_slots.push_back(slot_it);
b64251c
-				continue;
b64251c
+				slot->release_signal_ref();
b64251c
+				slot_it = slots.erase(slot_it);
b64251c
+			}
b64251c
+			else
b64251c
+			{
b64251c
+				slot->call(param1, param2, param3, param4, param5);
b64251c
+				slot_it++;
b64251c
 			}
b64251c
-			
b64251c
-			slot->call(param1, param2, param3, param4, param5);
b64251c
-		}
b64251c
-
b64251c
-		// remove all slots no longer connected to any CL_Slot.
b64251c
-		typename std::list<SlotIterator>::iterator remove_it;
b64251c
-		for (remove_it = remove_slots.begin(); remove_it != remove_slots.end(); remove_it++)
b64251c
-		{
b64251c
-			Slot slot = **remove_it;
b64251c
-			slot->release_signal_ref();
b64251c
-			slots.erase(*remove_it);
b64251c
 		}
b64251c
 	}
b64251c