зеркало из https://github.com/mozilla/gecko-dev.git
Fix memory leaks from changeset dcda49ff1a26 - need to make sure that
the destructor gets called for the hashtable entries. Also fixes a nit (AddRef() -> NS_ADDREF_THIS()) r+sr=bz
This commit is contained in:
Родитель
7732f9a2ae
Коммит
f8b424f36e
|
@ -183,7 +183,7 @@ nsProgressNotificationProxy::GetInterface(const nsIID& iid,
|
||||||
void** result) {
|
void** result) {
|
||||||
if (iid.Equals(NS_GET_IID(nsIProgressEventSink))) {
|
if (iid.Equals(NS_GET_IID(nsIProgressEventSink))) {
|
||||||
*result = static_cast<nsIProgressEventSink*>(this);
|
*result = static_cast<nsIProgressEventSink*>(this);
|
||||||
AddRef();
|
NS_ADDREF_THIS();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
if (mOriginalCallbacks)
|
if (mOriginalCallbacks)
|
||||||
|
|
|
@ -126,6 +126,12 @@ RequestInfoHashInitEntry(PLDHashTable *table, PLDHashEntryHdr *entry,
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
RequestInfoHashClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry)
|
||||||
|
{
|
||||||
|
nsRequestInfo* info = static_cast<nsRequestInfo *>(entry);
|
||||||
|
info->~nsRequestInfo();
|
||||||
|
}
|
||||||
|
|
||||||
struct nsListenerInfo {
|
struct nsListenerInfo {
|
||||||
nsListenerInfo(nsIWeakReference *aListener, unsigned long aNotifyMask)
|
nsListenerInfo(nsIWeakReference *aListener, unsigned long aNotifyMask)
|
||||||
|
@ -162,7 +168,7 @@ nsDocLoader::nsDocLoader()
|
||||||
PL_DHashVoidPtrKeyStub,
|
PL_DHashVoidPtrKeyStub,
|
||||||
PL_DHashMatchEntryStub,
|
PL_DHashMatchEntryStub,
|
||||||
PL_DHashMoveEntryStub,
|
PL_DHashMoveEntryStub,
|
||||||
PL_DHashClearEntryStub,
|
RequestInfoHashClearEntry,
|
||||||
PL_DHashFinalizeStub,
|
PL_DHashFinalizeStub,
|
||||||
RequestInfoHashInitEntry
|
RequestInfoHashInitEntry
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче