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:
Christian Biesinger 2009-07-28 19:46:04 +02:00
Родитель 7732f9a2ae
Коммит f8b424f36e
2 изменённых файлов: 8 добавлений и 2 удалений

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

@ -183,7 +183,7 @@ nsProgressNotificationProxy::GetInterface(const nsIID& iid,
void** result) {
if (iid.Equals(NS_GET_IID(nsIProgressEventSink))) {
*result = static_cast<nsIProgressEventSink*>(this);
AddRef();
NS_ADDREF_THIS();
return NS_OK;
}
if (mOriginalCallbacks)

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

@ -126,6 +126,12 @@ RequestInfoHashInitEntry(PLDHashTable *table, PLDHashEntryHdr *entry,
return PR_TRUE;
}
static void
RequestInfoHashClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry)
{
nsRequestInfo* info = static_cast<nsRequestInfo *>(entry);
info->~nsRequestInfo();
}
struct nsListenerInfo {
nsListenerInfo(nsIWeakReference *aListener, unsigned long aNotifyMask)
@ -162,7 +168,7 @@ nsDocLoader::nsDocLoader()
PL_DHashVoidPtrKeyStub,
PL_DHashMatchEntryStub,
PL_DHashMoveEntryStub,
PL_DHashClearEntryStub,
RequestInfoHashClearEntry,
PL_DHashFinalizeStub,
RequestInfoHashInitEntry
};