mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Fixed love.event.clear() (issue #666)
This commit is contained in:
@@ -39,7 +39,7 @@ Message::Message(const std::string &name, Variant *a, Variant *b, Variant *c, Va
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (!args[i])
|
||||
continue;
|
||||
break;
|
||||
args[i]->retain();
|
||||
nargs++;
|
||||
}
|
||||
@@ -112,7 +112,8 @@ void Event::clear()
|
||||
Lock lock(mutex);
|
||||
while (!queue.empty())
|
||||
{
|
||||
queue.back()->release();
|
||||
// std::queue::pop will remove the first (front) element.
|
||||
queue.front()->release();
|
||||
queue.pop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user