Fixed QI bug that could cause the input stream to be closed too early.

This commit is contained in:
warren%netscape.com 1999-08-26 00:25:20 +00:00
Родитель f5f517c65d
Коммит c726d36b08
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -193,15 +193,17 @@ nsPipe::QueryInterface(const nsIID& aIID, void** aInstancePtr)
if (aIID.Equals(nsIBufferInputStream::GetIID()) ||
aIID.Equals(nsIInputStream::GetIID()) ||
aIID.Equals(nsIBaseStream::GetIID())) {
*aInstancePtr = GetInputStream();
NS_ADDREF_THIS();
nsIBufferInputStream* in = GetInputStream();
NS_ADDREF(in);
*aInstancePtr = in;
return NS_OK;
}
if (aIID.Equals(nsIBufferOutputStream::GetIID()) ||
aIID.Equals(nsIOutputStream::GetIID()) ||
aIID.Equals(nsIBaseStream::GetIID())) {
*aInstancePtr = GetOutputStream();
NS_ADDREF_THIS();
nsIBufferOutputStream* out = GetOutputStream();
NS_ADDREF(out);
*aInstancePtr = out;
return NS_OK;
}
if (aIID.Equals(nsIPipe::GetIID()) ||