Browse Source

Small warning fix

Michael Ragazzon 6 years ago
parent
commit
a19c5bb349
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Source/Core/Context.cpp

+ 4 - 2
Source/Core/Context.cpp

@@ -694,7 +694,8 @@ void Context::ProcessMouseButtonUp(int button_index, int key_modifier_state)
 
 		// Unset the 'active' pseudo-class on all the elements in the active chain; because they may not necessarily
 		// have had 'onmouseup' called on them, we can't guarantee this has happened already.
-		std::for_each(active_chain.begin(), active_chain.end(), PseudoClassFunctor("active", false));
+		auto func = PseudoClassFunctor("active", false);
+		std::for_each(active_chain.begin(), active_chain.end(), func);
 		active_chain.clear();
 
 		if (drag)
@@ -1184,7 +1185,8 @@ void Context::SendEvents(const ElementSet& old_items, const ElementSet& new_item
 {
 	ElementList elements;
 	std::set_difference(old_items.begin(), old_items.end(), new_items.begin(), new_items.end(), std::back_inserter(elements));
-	std::for_each(elements.begin(), elements.end(), RKTEventFunctor(event, parameters, interruptible));
+	auto func = RKTEventFunctor(event, parameters, interruptible);
+	std::for_each(elements.begin(), elements.end(), func);
 }
 
 void Context::OnReferenceDeactivate()