Open Bug 587632 Opened 14 years ago Updated 2 years ago

nsXULPopupManager::ShowPopupCallback leaks item when ENSURE_TRUE(weakFrame.IsAlive()) fails

Categories

(Core :: XUL, defect)

x86
Windows 7
defect

Tracking

()

People

(Reporter: timeless, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, memory-leak)

Attachments

(1 file)

560  	nsXULPopupManager::ShowPopupCallback(nsIContent* aPopup,
564  	{

572  	  nsMenuChainItem* item =
573  	    new nsMenuChainItem(aPopupFrame, aIsContextMenu, popupType);
574  	  if (!item)
575  	    return;

595  	  nsWeakFrame weakFrame(aPopupFrame);
596  	  PRBool hasChildren = aPopupFrame->ShowPopup(aIsContextMenu, aSelectFirstItem);
597  	  ENSURE_TRUE(weakFrame.IsAlive());
Attached patch autoptrSplinter Review
smaug is forcing me to get rid of oom checks for new
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #466579 - Flags: review?(neil)
Comment on attachment 466579 [details] [diff] [review]
autoptr

>     mPopups = item;
>     SetCaptureState(oldmenu);
>   }
>+  item.forget();
Ideally you would mNoHidePanels = item.forget(); etc.
Attachment #466579 - Flags: review?(neil) → review+

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: timeless → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: