I saw using the Task Manager that the GDI leak in the following code is the GDI object in the process of implementing this code The count is 1 times every time, but I am unable to find the problem.
Any help would be appreciated.
// Create a new DC based on the current HDC HDC = Creative Digital Dc (GetDC); // Select a bitmap in the new DC and keep the old one HGDIOBJ hOldObj = SelectObject (HDC, HBM); // somthing here - & gt; 100% no leakage here is some function (HDC); // Remove the old object from the back and remove the deleted object (the selection object (HDC, H odd oBJ); // delete the DC deleted DC (HDC); // delete the TMP object removed (OOO J);
rm
copying from the comment, I do not As I answer it, I can not test it and I was not sure that it was correct, please check it.
General Currently it is nested call i.e.
ex> HDC HDC1 = get-DC (); HDC HDC2 = CreativeDC (HDC1); ..
HDC HDC = getDC ();
(In your code, BTWDC has not been sent back by GETDESS. )
Comments
Post a Comment