Closed Bug 2076 Opened 26 years ago Closed 26 years ago

Memory leak of nsScritNameSpaceManager object

Categories

(Core :: DOM: Core & HTML, defect, P1)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: troy, Assigned: vidur)

References

()

Details

Purify reports a leak of the script name space manager and its hash table. [W] MLK: Memory leak of 64 bytes from 1 block allocated in PR_Malloc Distribution of leaked blocks Allocation location malloc [dbgheap.c:129] PR_Malloc [prmem.c:38] DefaultAllocTable [plhash.c:53] PL_NewHashTable [plhash.c:123] nsScriptNameSpaceManager::RegisterGlobalName(nsString const&,nsID const&,int) [nsScriptNameSpaceManager.cpp:66] { if (nsnull == mGlobalNames) { mGlobalNames = PL_NewHashTable(4, PL_HashString, PL_CompareStrings, => PL_CompareValues, nsnull, nsnull); } char* name = aName.ToNewCString(); LayoutScriptNameSet::AddNameSet(nsIScriptContext *) [nsLayoutFactory.cpp:315] nsScriptNameSetRegistry::PopulateNameSpace(nsIScriptContext *) [nsScriptNameSetRegistry.cpp:78] nsJSContext::GetNameSpaceManager(nsIScriptNameSpaceManager * *) [nsJSEnvironment.cpp:224] nsJSUtils::nsGlobalResolve(JSContext *,JSObject *,long) [nsJSUtils.cpp:271] ResolveWindow [nsJSWindow.cpp:553] [W] MLK: Memory leak of 17 bytes from 1 block allocated in nsString::ToNewCString(void)const Distribution of leaked blocks Allocation location new(UINT) [new.cpp:23] nsString::ToNewCString(void)const [nsString.cpp:468] nsScriptNameSpaceManager::RegisterGlobalName(nsString const&,nsID const&,int) [nsScriptNameSpaceManager.cpp:69] LayoutScriptNameSet::AddNameSet(nsIScriptContext *) [nsLayoutFactory.cpp:315] nsScriptNameSetRegistry::PopulateNameSpace(nsIScriptContext *) [nsScriptNameSetRegistry.cpp:78] nsJSContext::GetNameSpaceManager(nsIScriptNameSpaceManager * *) [nsJSEnvironment.cpp:224] nsJSUtils::nsGlobalResolve(JSContext *,JSObject *,long) [nsJSUtils.cpp:271] ResolveWindow [nsJSWindow.cpp:553] js_LookupProperty [jsobj.c:1504] FindConstructor [jsobj.c:1168] [W] MLK: Memory leak of 20 bytes from 1 block allocated in PR_Malloc Distribution of leaked blocks Allocation location malloc [dbgheap.c:129] PR_Malloc [prmem.c:38] nsScriptNameSpaceManager::RegisterGlobalName(nsString const&,nsID const&,int) [nsScriptNameSpaceManager.cpp:70] LayoutScriptNameSet::AddNameSet(nsIScriptContext *) [nsLayoutFactory.cpp:315] nsScriptNameSetRegistry::PopulateNameSpace(nsIScriptContext *) [nsScriptNameSetRegistry.cpp:78] nsJSContext::GetNameSpaceManager(nsIScriptNameSpaceManager * *) [nsJSEnvironment.cpp:224] nsJSUtils::nsGlobalResolve(JSContext *,JSObject *,long) [nsJSUtils.cpp:271] ResolveWindow [nsJSWindow.cpp:553] js_LookupProperty [jsobj.c:1504] FindConstructor [jsobj.c:1168] [W] MLK: Memory leak of 16 bytes from 1 block allocated in PR_Malloc Distribution of leaked blocks Allocation location malloc [dbgheap.c:129] PR_Malloc [prmem.c:38] DefaultAllocEntry [plhash.c:73] PL_HashTableRawAdd [plhash.c:244] PL_HashTableAdd [plhash.c:275] nsScriptNameSpaceManager::RegisterGlobalName(nsString const&,nsID const&,int) [nsScriptNameSpaceManager.cpp:77] LayoutScriptNameSet::AddNameSet(nsIScriptContext *) [nsLayoutFactory.cpp:315] nsScriptNameSetRegistry::PopulateNameSpace(nsIScriptContext *) [nsScriptNameSetRegistry.cpp:78] nsJSContext::GetNameSpaceManager(nsIScriptNameSpaceManager * *) [nsJSEnvironment.cpp:224] nsJSUtils::nsGlobalResolve(JSContext *,JSObject *,long) [nsJSUtils.cpp:271] [W] MLK: Memory leak of 12 bytes from 1 block allocated in NS_NewScriptNameSpaceManager Distribution of leaked blocks Allocation location new(UINT) [new.cpp:23] NS_NewScriptNameSpaceManager [nsScriptNameSpaceManager.cpp:136] *aInstancePtr = NULL; => nsScriptNameSpaceManager *manager = new nsScriptNameSpaceManager(); if (nsnull == manager) { return NS_ERROR_OUT_OF_MEMORY; } nsJSContext::GetNameSpaceManager(nsIScriptNameSpaceManager * *) [nsJSEnvironment.cpp:217] nsJSUtils::nsGlobalResolve(JSContext *,JSObject *,long) [nsJSUtils.cpp:271] ResolveWindow [nsJSWindow.cpp:553] js_LookupProperty [jsobj.c:1504] FindConstructor [jsobj.c:1168] js_GetClassPrototype [jsobj.c:2411] js_NewObject [jsobj.c:1086] JS_InitClass [jsapi.c:980]
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Fixed. Missing NS_RELEASE. Thanks Troy.
vidur or troy - could you please verify this bug?
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.