Fixed crasher bug# 7311 by removing aggregation. Both constructors need to take an additional parameter that will initialize the outer need to happen. Doing the bigger change of introducing aggregation later

This commit is contained in:
dp%netscape.com 1999-05-28 22:09:32 +00:00
Родитель f4c0578972
Коммит 1fe0f8ea19
2 изменённых файлов: 3 добавлений и 20 удалений

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

@ -38,22 +38,7 @@ static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID);
#endif
//static NS_DEFINE_IID(kIFileSpecIID, NS_IFILESPEC_IID);
NS_IMPL_AGGREGATED(nsFileSpecImpl)
NS_IMETHODIMP
nsFileSpecImpl::AggregatedQueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (aInstancePtr == nsnull)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsIFileSpec::GetIID()) ||
aIID.Equals(nsISupports::GetIID())) {
*aInstancePtr = (nsIFileSpec*)this;
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ISUPPORTS(nsFileSpecImpl, nsIFileSpec::GetIID())
//----------------------------------------------------------------------------------------
nsFileSpecImpl::nsFileSpecImpl()
@ -747,8 +732,7 @@ NS_METHOD nsFileSpecImpl::Create(nsISupports* outer, const nsIID& aIID, void* *a
if (!it)
return NS_ERROR_OUT_OF_MEMORY;
nsISupports* inner = outer ? it->GetInner() : it;
nsresult rv = inner->QueryInterface(aIID, aIFileSpec);
nsresult rv = it->QueryInterface(aIID, aIFileSpec);
if (NS_FAILED(rv)) {
delete it;
return rv;

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

@ -21,7 +21,6 @@
#include "nsIFileSpec.h"
#include "nsFileSpec.h"
#include "nsAgg.h"
//========================================================================================
class NS_COM nsFileSpecImpl
@ -31,7 +30,7 @@ class NS_COM nsFileSpecImpl
public:
NS_DECL_AGGREGATED
NS_DECL_ISUPPORTS
NS_IMETHOD fromFileSpec(const nsIFileSpec *original);