Source/Gorgon/Main.cpp

branch
4.x-dev
changeset 1728
92bb193f0a6e
parent 1584
4606aeb9823a
child 1729
06588a526327
equal deleted inserted replaced
1727:20deab12df40 1728:92bb193f0a6e
56 56
57 namespace Gorgon { 57 namespace Gorgon {
58 58
59 Event<> BeforeFrameEvent; 59 Event<> BeforeFrameEvent;
60 60
61 std::mutex once_mtx;
61 std::vector<std::function<void()>> once; 62 std::vector<std::function<void()>> once;
62 63
63 bool exiting = false; 64 bool exiting = false;
64 65
65 namespace internal { 66 namespace internal {
144 145
145 OS::processmessages(); 146 OS::processmessages();
146 } 147 }
147 148
148 void RegisterOnce(std::function<void()> fn) { 149 void RegisterOnce(std::function<void()> fn) {
150 std::lock_guard<std::mutex> grd(once_mtx);
151
149 once.push_back(fn); 152 once.push_back(fn);
150 } 153 }
154
151 } 155 }

mercurial