I've got AV here:
function TContentManager.CloseFakeHandleAndReleaseStream(Handle: THandle): BOOL;
.................
Pair := TFakeHandleStreamPair(m_ListOfFakeHandleStream[nIndex]);
.................
And I beleave it's because you don't delete the Pair from the list after Pair is freed. Really your code should look like this:
..............
if Pair.m_Handle = Handle then
begin
Pair.Free;
>>>>>>>>>>>>>>>>>>>>>
m_ListOfFakeHandleStream.Delete(nIndex);
>>>>>>>>>>>>>>>>>>>>>
Result := True;
break;
end;
..............
AV disappeared after I inserted this line.
Thanks.