Closed Bug 486621 Opened 16 years ago Closed 16 years ago

Should close file handle in gfxWindowsPlatform::FindFonts()

Categories

(Core :: Graphics, defect)

ARM
Windows CE
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: hiro, Unassigned)

Details

Attachments

(1 file, 2 obsolete files)

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
OS: Other → Windows CE
Hardware: Other → ARM
Attached patch Proposed patch (obsolete) — Splinter Review
Attachment #370778 - Flags: review?(bugmail)
Attached patch update (obsolete) — Splinter Review
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 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+
Attached patch Update patchSplinter Review
Address Brad's comment.
Attachment #370781 - Attachment is obsolete: true
Attachment #371542 - Flags: review+
Keywords: checkin-needed
Comment on attachment 371542 [details] [diff] [review] Update patch requesting review from module owner
Attachment #371542 - Flags: review+ → review?(vladimir)
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.

Attachment

General

Created:
Updated:
Size: