Closed Bug 119547 Opened 24 years ago Closed 8 years ago

Memory leak of 28 bytes from 1 block allocated in nsSimpleURI::Create

Categories

(Core :: DOM: Navigation, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE
Future

People

(Reporter: stephend, Unassigned)

References

()

Details

(Keywords: memory-leak, topembed-)

Attachments

(1 file)

Sorry, this was Warren's code... Build ID: Latest trunk pulled on Windows 2000 running under Purify. Steps to reproduce: 1. start mozilla 2. go to http://lxr.mozilla.org/seamonkey/source/layout/xul/base/src/nsBoxFrame.cpp 3. file -> send page 4. enter a recipient and click send 5. exit [W] MLK: Memory leak of 28 bytes from 1 block allocated in nsSimpleURI::Create (nsISupports *,nsID const&,void * *) Distribution of leaked blocks Allocation location new(UINT) [MSVCRT.DLL] nsSimpleURI::Create(nsISupports *,nsID const&,void * *) [nsSimpleURI.cpp:350] NS_ENSURE_ARG_POINTER(aResult); NS_ENSURE_PROPER_AGGREGATION(aOuter, aIID); => nsSimpleURI* url = new nsSimpleURI(aOuter); if (url == nsnull) return NS_ERROR_OUT_OF_MEMORY; nsGenericFactory::CreateInstance(nsISupports *,nsID const&,void * *) [nsGenericFactory.cpp:74] REFNSIID aIID, void **aResult) { if (mInfo->mConstructor) { => return mInfo->mConstructor(aOuter, aIID, aResult); } return NS_ERROR_FACTORY_NOT_REGISTERED; nsComponentManagerImpl::CreateInstance(nsID const&,nsISupports *,nsID const&,void * *) [nsComponentManager.cpp:1609] nsresult res = FindFactory(aClass, &factory); if (NS_SUCCEEDED(res)) { => res = factory->CreateInstance(aDelegate, aIID, aResult); NS_RELEASE(factory); } else nsComponentManager::CreateInstance(nsID const&,nsISupports *,nsID const&,void * *) [nsComponentManagerObsolete.cpp:102] nsIComponentManagerObsolete* cm; nsresult rv = NS_GetGlobalComponentManager((nsIComponentManager**)&cm); if (NS_FAILED(rv)) return rv; => return cm->CreateInstance(aClass, aDelegate, aIID, aResult); } nsresult nsAboutProtocolHandler::NewURI(char const*,nsIURI *,nsIURI * *) [nsAboutProtocolHandler.cpp:127] nsIURI* url; rv = nsComponentManager::CreateInstance(kSimpleURICID, nsnull, NS_GET_IID(nsIURI), => (void**)&url); if (NS_FAILED(rv)) return rv; rv = url->SetSpec((char*)aSpec); if (NS_FAILED(rv)) { nsIOService::NewURI(char const*,nsIURI *,nsIURI * *) [nsIOService.cpp:746] } if (NS_FAILED(rv)) return rv; => return handler->NewURI(aSpec, base, result); } NS_NewURI(nsIURI * *,char const*,nsIURI *,nsIIOService *) [nsNetUtil.h:97] NS_NewURI(nsIURI * *,nsAString const&,nsIURI *,nsIIOService *) [nsNetUtil.h:109] nsDefaultURIFixup::CreateFixupURI(WORD const*,UINT,nsIURI * *) [nsDefaultURIFixup.cpp:115] } // Just try to create an URL out of it => NS_NewURI(aURI, uriString, nsnull); if(*aURI) { if (aFixupFlags & FIXUP_FLAGS_MAKE_ALTERNATE_URI) MakeAlternateURI(*aURI); nsDocShell::CreateFixupURI(WORD const*,nsIURI * *) [nsDocShell.cpp:4177] // Call the fixup object return mURIFixup->CreateFixupURI(aStringURI, => nsIURIFixup::FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP, aURI); } NS_IMETHODIMP nsDocShell::LoadURI(WORD const*,UINT,nsIURI *,nsIInputStream *,nsIInputStream *) [nsDocShell.cpp:2248] { nsCOMPtr<nsIURI> uri; => nsresult rv = CreateFixupURI(aURI, getter_AddRefs(uri)); if (NS_ERROR_UNKNOWN_PROTOCOL == rv) { // we weren't able to find a protocol handler nsWebShellWindow::Initialize(nsIXULWindow *,nsIAppShell *,nsIURI *,int,int,UINT,int,int,int,nsWidgetInitData&) [nsWebShellWindow.cpp:344] nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, => nsnull); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); } nsAppShellService::JustCreateTopWindow(nsIXULWindow *,nsIURI *,int,int,UINT,int,int,int,nsIXULWindow * *) [nsAppShellService.cpp:542] rv = window->Initialize(aParent, mAppShell, aUrl, aShowWindow, aLoadDefaultPage, zlevel, => aInitialWidth, aInitialHeight, aIsHiddenWindow, widgetInitData); if (NS_SUCCEEDED(rv)) { nsAppShellService::CreateHiddenWindow(void) [nsAppShellService.cpp:269] nsCOMPtr<nsIXULWindow> newWindow; rv = JustCreateTopWindow(nsnull, url, PR_FALSE, PR_FALSE, chromeMask, initialWidth, initialHeight, => PR_TRUE, getter_AddRefs(newWindow)); if (NS_SUCCEEDED(rv)) { mHiddenWindow = newWindow; main1 [nsAppRunner.cpp:1225] // rjc: now must explicitly call appshell's CreateHiddenWindow() function AFTER profile manager. // if the profile manager ever switches to using nsIDOMWindowInternal stuff, this might have to change NS_TIMELINE_ENTER("appShell->CreateHiddenWindow"); => appShell->CreateHiddenWindow(); NS_TIMELINE_LEAVE("appShell->CreateHiddenWindow"); // This will go away once Components are handling there own commandlines main [nsAppRunner.cpp:1594] } #endif => nsresult mainResult = main1(argc, argv, nativeApp ? (nsISupports*) nativeApp : (nsISupports*)splash); /* if main1() didn't succeed, then don't bother trying to shut down clipboard, etc */ if (NS_SUCCEEDED(mainResult)) { WinMain [nsAppRunner.cpp:1612] WinMainCRTStartup [crtexew.obj]
Keywords: mlk
Target Milestone: --- → mozilla0.9.8
Target Milestone: mozilla0.9.8 → mozilla0.9.9
I am attaching the tree created using the refcount balancer. The URI is not being released somewhere in nsWebShellWindow/nsAppShellService. Reassigning to docshell for now. Please reassign as necessary.
Assignee: neeti → adamlock
Component: Networking → Embedding: Docshell
QA Contact: benc → adamlock
Target Milestone: mozilla0.9.9 → Future
Keywords: nsbeta1nsbeta1-, topembed
Keywords: topembedtopembed-
Assignee: adamlock → nobody
QA Contact: adamlock → docshell
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: