Last Comment Bug 679196 - Mem leak when preferred effect is set for drag and drop
: Mem leak when preferred effect is set for drag and drop
Status: RESOLVED FIXED
[MemShrink]
: mlk
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal (vote)
: mozilla9
Assigned To: Brian R. Bondy [:bbondy]
:
Mentors:
Depends on: 573321
Blocks: 296528
  Show dependency treegraph
 
Reported: 2011-08-15 16:18 PDT by Brian R. Bondy [:bbondy]
Modified: 2011-09-13 06:43 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fixes memleak for when preferred effect memory is allcoated (1.06 KB, patch)
2011-08-16 20:17 PDT, Brian R. Bondy [:bbondy]
neil: review+
Details | Diff | Review

Description Brian R. Bondy [:bbondy] 2011-08-15 16:18:59 PDT
Bug 296528 introduced a memory leak with the following code in nsClipboard.cpp:

>   nsresult loadResult = nsClipboard::GetNativeDataOffClipboard(
>       pIDataSource, 0, ::RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT), nsnull, &tempOutData, &tempDataLen);

tempOutData should be freed.

The memory leak is only hit when Windows deicdes to set a preferred effect on the data source, which doesn't happen often.

Windows does set it sometimes when dragging from Windows explorer and always when dragging from an FTP site.
Comment 1 Brian R. Bondy [:bbondy] 2011-08-16 20:17:21 PDT
Created attachment 553669 [details] [diff] [review]
Fixes memleak for when preferred effect memory is allcoated

Neil this is the mem leak you noticed, so I'm setting you as the reviewer :)
Comment 2 Brian R. Bondy [:bbondy] 2011-09-08 09:29:26 PDT
Pushed to try:
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=a34d0baace5c
Comment 3 :Ehsan Akhgari (busy, don't ask for review please) 2011-09-12 14:53:23 PDT
Seems like this fell through the cracks!  I rebased and landed it on inbound:

http://hg.mozilla.org/integration/mozilla-inbound/rev/3f3380cfd15a
Comment 4 Brian R. Bondy [:bbondy] 2011-09-12 16:52:56 PDT
> Seems like this fell through the cracks!  

Nah I'm just behind on pushing my tasks out.  I had about 30 ready to go  in but didn't have level 3 commit access until about 3 weeks ago.  My rate of task creation vs pushing is fixed now so I should eventually get caught up :)
Comment 5 Ed Morley [:emorley] 2011-09-12 16:55:40 PDT
If you want a hand catching up, there is always checkin-needed :-)
Comment 6 Brian R. Bondy [:bbondy] 2011-09-12 16:59:28 PDT
nah mostly I need to run through try and verify things are ok.  I'm getting close to caught up already.  I try to put about 10 to try per week to get caught up right now.  This bug and the related drag and drop series of bugs are next on my list, but all hands in the way :)
Comment 7 Brian R. Bondy [:bbondy] 2011-09-12 17:03:32 PDT
> I rebased and landed it on inbound

Thanks by the way :)
Comment 8 Matt Brubeck (:mbrubeck) 2011-09-13 06:43:04 PDT
https://hg.mozilla.org/mozilla-central/rev/3f3380cfd15a

Note You need to log in before you can comment on or make changes to this bug.