mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-11 19:54:03 +00:00
CLOUD: Fix ConnectionManager a little
I didn't like how FINISHED Requests were waiting until the next interateRequests() call to be removed when we could easily remove those after they changed their state in their handle().
This commit is contained in:
parent
bcb2a5bd8d
commit
b32c2be78d
@ -110,6 +110,11 @@ void ConnectionManager::interateRequests() {
|
||||
debug("handling %d request(s)", _requests.size());
|
||||
for (Common::Array<RequestWithCallback>::iterator i = _requests.begin(); i != _requests.end();) {
|
||||
Request *request = i->request;
|
||||
if (request) {
|
||||
if (request->state() == PROCESSING) request->handle();
|
||||
else if (request->state() == RETRY) request->handleRetry();
|
||||
}
|
||||
|
||||
if (!request || request->state() == FINISHED) {
|
||||
delete (i->request);
|
||||
if (i->onDeleteCallback) (*i->onDeleteCallback)(i->request); //that's not a mistake (we're passing an address and that method knows there is no object anymore)
|
||||
@ -117,11 +122,6 @@ void ConnectionManager::interateRequests() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (request) {
|
||||
if (request->state() == PROCESSING) request->handle();
|
||||
else if (request->state() == RETRY) request->handleRetry();
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
if (_requests.empty()) stopTimer();
|
||||
|
Loading…
Reference in New Issue
Block a user