Skip to content

Commit f1b152b

Browse files
Avoid gcc shadow warning
1 parent 09ed48d commit f1b152b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/system/tests/TestEventLoopHandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ class TestEventLoopHandler : public ::testing::Test
5050
template <class Lambda>
5151
static std::function<void()> Schedule(Timeout delay, Lambda lambda)
5252
{
53-
auto * function = new std::function<void()>(lambda);
5453
System::TimerCompleteCallback callback = [](System::Layer * layer, void * ctx) {
5554
auto * function = static_cast<std::function<void()> *>(ctx);
5655
(*function)();
5756
delete function;
5857
};
58+
auto * function = new std::function<void()>(lambda);
5959
SystemLayer().StartTimer(delay, callback, function);
6060
return [=] { SystemLayer().CancelTimer(callback, function); };
6161
}

0 commit comments

Comments
 (0)