Closed
Bug 486621
Opened 16 years ago
Closed 16 years ago
Should close file handle in gfxWindowsPlatform::FindFonts()
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: hiro, Unassigned)
Details
Attachments
(1 file, 2 obsolete files)
801 bytes,
patch
|
vlad
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja; rv:1.8.0.4) Gecko/20060508 Firefox/3.0
Build Identifier:
Should close file handle in gfxWindowsPlatform::FindFonts().
Reproducible: Always
Reporter | ||
Updated•16 years ago
|
OS: Other → Windows CE
Hardware: Other → ARM
Reporter | ||
Comment 1•16 years ago
|
||
Attachment #370778 -
Flags: review?(bugmail)
Reporter | ||
Comment 2•16 years ago
|
||
Ooops! I am silly.
+ if (handle != INVALID_HANDLE_VALUE)
Of course this is "handle == INVALID_HANDLE_VALUE".
Attachment #370778 -
Attachment is obsolete: true
Attachment #370781 -
Flags: review?(bugmail)
Attachment #370778 -
Flags: review?(bugmail)
Comment 3•16 years ago
|
||
Comment on attachment 370781 [details] [diff] [review]
update
>diff -r 50e34c4934c2 gfx/thebes/src/gfxWindowsPlatform.cpp
>--- a/gfx/thebes/src/gfxWindowsPlatform.cpp Fri Apr 03 09:35:07 2009 +0900
>+++ b/gfx/thebes/src/gfxWindowsPlatform.cpp Fri Apr 03 12:11:21 2009 +0900
>@@ -278,24 +278,27 @@ gfxWindowsPlatform::FindFonts()
> searchPaths.AppendElement(pathBuf);
> WIN32_FIND_DATAW results;
> for (PRUint32 i = 0; i < searchPaths.Length(); i++) {
> const nsString& path(searchPaths[i]);
> for (PRUint32 j = 0; j < fontPatterns.Length(); j++) {
> nsAutoString pattern(path);
> pattern.Append(fontPatterns[j]);
> HANDLE handle = FindFirstFileW(pattern.get(), &results);
>- PRBool moreFiles = handle != INVALID_HANDLE_VALUE;
>+ if (handle == INVALID_HANDLE_VALUE)
>+ continue;
>+ PRBool moreFiles = PR_TRUE;
> while (moreFiles) {
> nsAutoString filePath(path);
> filePath.AppendLiteral("\\");
> filePath.Append(results.cFileName);
> AppendFacesFromFontFile(static_cast<const PRUnichar*>(filePath.get()));
> moreFiles = FindNextFile(handle, &results);
> }
>+ FindClose(handle);
> }
> }
> }
>
> #endif
>
>
> nsresult
Doing something like this would be cleaner:
if (handle != INVALID_HANDLE_VALUE)
FindClose(handle);
r=me with that change
Attachment #370781 -
Flags: review?(bugmail) → review+
Reporter | ||
Comment 4•16 years ago
|
||
Address Brad's comment.
Attachment #370781 -
Attachment is obsolete: true
Attachment #371542 -
Flags: review+
Reporter | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 5•16 years ago
|
||
Comment on attachment 371542 [details] [diff] [review]
Update patch
requesting review from module owner
Attachment #371542 -
Flags: review+ → review?(vladimir)
Updated•16 years ago
|
Keywords: checkin-needed
Attachment #371542 -
Flags: review?(vladimir) → review+
Comment 6•16 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•