RE: GDI Object Select leak question
"Johann Gerell" <[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <E7878E5B9FDD467E80ABB2E8D2210B8B@Gerelllaptop1> |
That DeleteObject(hBrush) of yours will fail if hBrush is still selected in the device context. Check your return values. /Johann -----Ursprungligt meddelande----- Från: [email protected] [mailto:[email protected]] För todd Skickat: den 2 februari 2010 22:35 Till: [email protected] Ämne: [wtl] GDI Object Select leak question if you select an object into a DC, then delete the object before selecting the previous object back into it, is it a memory leak? hBrushOld = (HBRUSH) SelectObject(hdc, hBrush); // you forget to do this: SelectObject(hdc, hBrushOld); DeleteObject(hBrush); since hBrush is still selected, is it not deleted? ------------------------------------ Yahoo! Groups Links ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/