Authored by Bogdan Poplauschi

Merge pull request #683 from brynbodayle/master

Fixed issue where cancelled operations aren't removed from runningOperations.
@@ -197,6 +197,10 @@ @@ -197,6 +197,10 @@
197 }]; 197 }];
198 operation.cancelBlock = ^{ 198 operation.cancelBlock = ^{
199 [subOperation cancel]; 199 [subOperation cancel];
  200 +
  201 + @synchronized (self.runningOperations) {
  202 + [self.runningOperations removeObject:weakOperation];
  203 + }
200 }; 204 };
201 } 205 }
202 else if (image) { 206 else if (image) {