mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fix undefined behavior
This commit is contained in:
		| @@ -304,7 +304,7 @@ void InputHandler::dispatchMainThread(const std::function<void()> & functor) | ||||
| 	auto heapFunctor = new std::function<void()>(functor); | ||||
|  | ||||
| 	SDL_Event event; | ||||
| 	event.type = SDL_USEREVENT; | ||||
| 	event.user.type = SDL_USEREVENT; | ||||
| 	event.user.code = 0; | ||||
| 	event.user.data1 = static_cast <void*>(heapFunctor); | ||||
| 	event.user.data2 = nullptr; | ||||
|   | ||||
| @@ -33,7 +33,7 @@ namespace vstd | ||||
|  | ||||
| 		explicit ScopeGuard(Func && f): | ||||
| 			fire(true), | ||||
| 			f(std::forward<Func>(f)) | ||||
| 			f(std::move(f)) | ||||
| 		{} | ||||
| 		~ScopeGuard() | ||||
| 		{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user