1
0
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:
Ivan Savenko 2024-02-12 12:33:09 +02:00
parent 2540685c62
commit b796ed8626
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -33,7 +33,7 @@ namespace vstd
explicit ScopeGuard(Func && f):
fire(true),
f(std::forward<Func>(f))
f(std::move(f))
{}
~ScopeGuard()
{