Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1987

CreateFont / DeleteObject leaves font file locked on application exit

$
0
0
Hello,

I use the CreateFont/DeleteObject functions to load/create and release a customer font in my Win32 Application.

Code:
hFont = CreateFont(fontHeight, 0, 0, 0, 0, 0, 0, 0, OEM_CHARSET, 0, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH, szFontName);
...
if (hFont != NULL) {

        BOOL bResult = DeleteObject(hFont);

        hFont = NULL;

        if (!bResult) {

            throw new std::runtime_error("Cannot delete font");

        }

    }
The DeleteObject correctly...

CreateFont / DeleteObject leaves font file locked on application exit

Viewing all articles
Browse latest Browse all 1987

Trending Articles