зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
f4c0578972
Коммит
1fe0f8ea19
|
@ -38,22 +38,7 @@ static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//static NS_DEFINE_IID(kIFileSpecIID, NS_IFILESPEC_IID);
|
//static NS_DEFINE_IID(kIFileSpecIID, NS_IFILESPEC_IID);
|
||||||
NS_IMPL_AGGREGATED(nsFileSpecImpl)
|
NS_IMPL_ISUPPORTS(nsFileSpecImpl, nsIFileSpec::GetIID())
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------
|
||||||
nsFileSpecImpl::nsFileSpecImpl()
|
nsFileSpecImpl::nsFileSpecImpl()
|
||||||
|
@ -747,8 +732,7 @@ NS_METHOD nsFileSpecImpl::Create(nsISupports* outer, const nsIID& aIID, void* *a
|
||||||
if (!it)
|
if (!it)
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
nsISupports* inner = outer ? it->GetInner() : it;
|
nsresult rv = it->QueryInterface(aIID, aIFileSpec);
|
||||||
nsresult rv = inner->QueryInterface(aIID, aIFileSpec);
|
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
delete it;
|
delete it;
|
||||||
return rv;
|
return rv;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
#include "nsIFileSpec.h"
|
#include "nsIFileSpec.h"
|
||||||
#include "nsFileSpec.h"
|
#include "nsFileSpec.h"
|
||||||
#include "nsAgg.h"
|
|
||||||
|
|
||||||
//========================================================================================
|
//========================================================================================
|
||||||
class NS_COM nsFileSpecImpl
|
class NS_COM nsFileSpecImpl
|
||||||
|
@ -31,7 +30,7 @@ class NS_COM nsFileSpecImpl
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_DECL_AGGREGATED
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD fromFileSpec(const nsIFileSpec *original);
|
NS_IMETHOD fromFileSpec(const nsIFileSpec *original);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче