urlmon: Release IInternetProtocolSink and BindInfo on request handle closure, not on first handle closure.

This commit is contained in:
Misha Koshelev 2007-11-11 00:56:12 -06:00 committed by Alexandre Julliard
parent f40955bf54
commit 0a158e7aa3
1 changed files with 14 additions and 12 deletions

View File

@ -148,15 +148,9 @@ static void HTTPPROTOCOL_Close(HttpProtocol *This)
This->http_negotiate = 0;
}
if (This->request)
{
InternetCloseHandle(This->request);
This->request = 0;
}
if (This->connect)
{
InternetCloseHandle(This->connect);
This->connect = 0;
}
if (This->internet)
{
InternetCloseHandle(This->internet);
@ -208,6 +202,13 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback(
IInternetProtocol_AddRef((IInternetProtocol *)This);
return;
case INTERNET_STATUS_HANDLE_CLOSING:
if (*(HINTERNET *)lpvStatusInformation == This->connect)
{
This->connect = 0;
}
else if (*(HINTERNET *)lpvStatusInformation == This->request)
{
This->request = 0;
if (This->protocol_sink)
{
IInternetProtocolSink_Release(This->protocol_sink);
@ -218,6 +219,7 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback(
ReleaseBindInfo(&This->bind_info);
memset(&This->bind_info, 0, sizeof(This->bind_info));
}
}
IInternetProtocol_Release((IInternetProtocol *)This);
return;
default: