Our WinCE port stores HDC's in an OwnPtr, so we added a deleteOwnedPtr override for HDC. I've enabled this for all Windows builds, because it seems useful for all of them and will optimize out if it's not used. I could easily change the patch to define it for WINCE only if that's preferred. Yong points out that only HDC's created with CreateCompatibleDC can be stored in an OwnPtr - those returned by GetDC would be double-deleted. I don't think this is dangerous because it's the same situation with any resource that's deleted by someone else: you don't own HDC's returned by GetDC, so you shouldn't put them in an OwnPtr.
Created attachment 32380 [details] patch implemented deleteOwnedPtr(HDC) for Windows
Committing to http://svn.webkit.org/repository/webkit/trunk ... M JavaScriptCore/ChangeLog M JavaScriptCore/wtf/OwnPtrCommon.h M JavaScriptCore/wtf/OwnPtrWin.cpp Committed r45669 M JavaScriptCore/wtf/OwnPtrWin.cpp M JavaScriptCore/wtf/OwnPtrCommon.h M JavaScriptCore/ChangeLog r45669 = fdd939e9c7043d4f6e1b9643a262aaf50a7ec2af (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/45669