mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Fix undefined behavior
This commit is contained in:
parent
2540685c62
commit
b796ed8626
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user