mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +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);
|
auto heapFunctor = new std::function<void()>(functor);
|
||||||
|
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
event.type = SDL_USEREVENT;
|
event.user.type = SDL_USEREVENT;
|
||||||
event.user.code = 0;
|
event.user.code = 0;
|
||||||
event.user.data1 = static_cast <void*>(heapFunctor);
|
event.user.data1 = static_cast <void*>(heapFunctor);
|
||||||
event.user.data2 = nullptr;
|
event.user.data2 = nullptr;
|
||||||
|
@@ -33,7 +33,7 @@ namespace vstd
|
|||||||
|
|
||||||
explicit ScopeGuard(Func && f):
|
explicit ScopeGuard(Func && f):
|
||||||
fire(true),
|
fire(true),
|
||||||
f(std::forward<Func>(f))
|
f(std::move(f))
|
||||||
{}
|
{}
|
||||||
~ScopeGuard()
|
~ScopeGuard()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user