Closed Bug 284327 Opened 19 years ago Closed 19 years ago

SHGetMalloc API call is deprecated (nsFilePicker.cpp)

Categories

(Core :: Widget: Win32, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: David.R.Gardiner, Assigned: David.R.Gardiner)

References

Details

Attachments

(1 obsolete file)

According to the MSDN documentation
(http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/shgetmalloc.asp)

"This function should no longer be used. Use the CoTaskMemFree and
CoTaskMemAlloc functions in its place"

Used in:

/widget/src/windows/nsFilePicker.cpp, line 169 -- ::SHGetMalloc(&pMalloc);

-dave
Assignee: win32 → david.gardiner
Status: NEW → ASSIGNED
Attachment #176131 - Flags: review?(dean_tessman)
Comment on attachment 176131 [details] [diff] [review]
Use CoTaskMemFree to release memory

MS's documentation for SHBrowseForFolder doesn't reflect this.

"The calling application is responsible for freeing the returned PIDL by using
the Shell allocator's IMalloc::Free method. To retrieve a handle to that
IMalloc interface, call SHGetMalloc. For further discussion of the Shell
allocator and PIDLs, see The Shell Namespace."

But SHGetMalloc is definitely not their preferred way.

r=me, assuming you've done the proper checks to ensure there are no leaks.
Attachment #176131 - Flags: review?(dean_tessman) → review+
Attachment #176131 - Flags: superreview?(neil.parkwaycc.co.uk)
Summary: SHGetMalloc API call is deprecated (nsFilePicker.cpp) → SHGetMalloc API call is deprecated (nsFilePicker.cpp)
Comment on attachment 176131 [details] [diff] [review]
Use CoTaskMemFree to release memory

I seem to remember the distinction depends on whether you use OLE or not - if
you don't, you can avoid loading it by calling SHGetMalloc.
Attachment #176131 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
If someone would like to check this in, that would be great!

thanks,
-david
Attachment #176131 - Flags: approval1.8b3?
Comment on attachment 176131 [details] [diff] [review]
Use CoTaskMemFree to release memory

a=shaver
Attachment #176131 - Flags: approval1.8b3? → approval1.8b3+
Comment on attachment 176131 [details] [diff] [review]
Use CoTaskMemFree to release memory

2005-06-01 16:20
mozilla/widget/src/windows/nsFilePicker.cpp	1.82
Attachment #176131 - Attachment is obsolete: true
Marking FIXED unless anyone objects :)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: