Browse Source

fixed memory leak

pull/93/head
orignal 11 years ago
parent
commit
05a96fd398
  1. 11
      SSUData.cpp

11
SSUData.cpp

@ -126,7 +126,9 @@ namespace ssu
} }
else else
break; break;
} }
if (isLast)
LogPrint ("Message ", msgID, " complete");
} }
} }
else else
@ -138,7 +140,12 @@ namespace ssu
{ {
// missing fragment // missing fragment
LogPrint ("Missing fragments from ", (int)incompleteMessage->nextFragmentNum, " to ", fragmentNum - 1, " of message ", msgID); LogPrint ("Missing fragments from ", (int)incompleteMessage->nextFragmentNum, " to ", fragmentNum - 1, " of message ", msgID);
incompleteMessage->savedFragments.insert (new Fragment (fragmentNum, buf, fragmentSize, isLast)); auto savedFragment = new Fragment (fragmentNum, buf, fragmentSize, isLast);
if (!incompleteMessage->savedFragments.insert (savedFragment).second)
{
LogPrint ("Fragment ", (int)fragmentNum, " of message ", msgID, " already saved");
delete savedFragment;
}
} }
isLast = false; isLast = false;
} }

Loading…
Cancel
Save