Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
Fixed memory leak problem
Browse files Browse the repository at this point in the history
When the node number is greater than 4, it will cause memory leaks.
  • Loading branch information
yaoxp committed Dec 7, 2016
1 parent 9b98410 commit 0561b19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SPDY/SPDYStreamManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ - (void)removeAllStreams
{
// Update linked list
for (int i = 0; i < 8; i++) {
SPDYStreamNode *currentNode = _priorityHead[i];
while (currentNode != NULL && currentNode->next != NULL) {
SPDYStreamNode *nextNode = currentNode->next;
currentNode->next = NULL;
currentNode->prev = NULL;
currentNode = nextNode;
}
currentNode = NULL;
_priorityHead[i] = NULL;
_priorityLast[i] = NULL;
}
Expand Down

0 comments on commit 0561b19

Please sign in to comment.