[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Rewrite CLinkControl to fix drdump bug #175094

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Fri, 18 Dec 2015 11:11:22 +0300

On 17 December 2015 at 20:51, Ivan Zhakov <ivan_at_visualsvn.com> wrote:
> On 16 December 2015 at 22:14, Stefan Kueng <tortoisesvn_at_gmail.com> wrote:
>>
>>
>> On 16.12.2015 17:11, Ivan Zhakov wrote:
>>>
>>> Hi,
>>>
>>> The most often reported crash in TortoiseSVN 1.9.3 is problem 175094
>>> [1, 2]: it's reported 152 times just in the first day of release. The
>>> crash happens in
>>> CStandAloneDialogTmpl<CResizableDialog>::OnEraseBkgnd(CDC * pDC)
>>> because pDC == NULL. It could not happen according MSDN documentation
>>> for WM_ERASEBKGND. But WM_ERASEBKGND passes through CLinkControl which
>>> is actually subclasses parent windows of control using some custom
>>> code.
>>
>>
>> The problem here is simple exhaustion of GDI handles. That's why the DC is
>> NULL: Windows won't create a new DC if there are no more GDI handles
>> available.
>> See the "GDI Resource" count in the crash xml file of a full dump zip.
>>
> Heh, I forgot about crash xml file.
>
>> I found the real problem and fixed it in r27056.
>>
> Great! Btw I noticed that CSysImageList::GetFileIcon() has the same
> resource leak. There is also discrepancy between
> CSysImageList::GetPathIconIndex() and
> CSysImageList::EnsureFileIconIsLoaded():
> - GetPathIconIndex() uses by m_indexCache(), while
> EnsureFileIconIsLoaded() does not.
> - CSysImageList::GetFileIcon() asks for SHGFI_SYSICONINDEX, while
> EnsureFileIconIsLoaded() uses SHGFI_ICON.
>
> I think EnsureFileIconIsLoaded() should use SHGFI_SYSICONINDEX for
> consistency, otherwise may return HICON without adding icon to
> imagelist.
>
>
Well, it seems code could be improved even more: just do not
useI_IMAGECALLBACK in CSVNStatusListCtrl::AddEntry(). This guarantee
that imagelist wouldn't invoke OLE or anything else. It also should
speedup CSVNStatusListCtrl a bit. See attached patch. What do you
think?

-- 
Ivan Zhakov
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3151263
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2015-12-18 13:48:49 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.