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

Re: intl3_svn.dll & another TSVN dlls

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-05-23 10:31:08 CEST

On 5/23/07, George Hazan <george.hazan@gmail.com> wrote:
> Hello, Stefan!
> Wed, 23 May 2007 07:26:42 +0200 you wrote:
>
> SK> ShellExecute() is an API to start another process. Of course you don't
> SK> call that one. But I'm sure you're using some other shell API which
> SK> loads the shell dll with the extensions.
>
> Only Shell_NotifyIcon gets called to this moment... Hmm...

What about SHGetFileInfoA in LoadIconsAndTypesThread(), file
src\modules\srfile\fileexistsdlg.c ?
And *that* API will definitely load the overlay extension.
I'm sure there are other places where you load the extensions.

> SK> Just step through your app until the dll's are loaded (you should see
> SK> that in the debugger window). Then you'll know what API call is
> SK> responsible for this.
>
> Ok :)
>
> >> What about process filtering? Just quit without loading, if the process
> >> name isn't an explorer, or TC, or FAR.
> SK> What do you think the setting "show overlays only in explorer" does?
>
> I don't think that this option does anything with these DLLs. At least I
> can't see any visible difference.

http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/TortoiseShell/IconOverlay.cpp
right at the top we check whether the process name is "explorer.exe"
and bail out if it isn't.
Ok, that of course means the dll's are already loaded, but they're not used.
Problem is: the *shell* loads our dll, and we can't tell the shell not to.

> SK> I can assure you that the tsvn shell extension has no memory leaks at
> SK> all.
>
> BoundsChecker has the different point of view on this problem :)

My guess would be that you don't cleanly free some resources you get
with some shell API call.
And as I just discovered: I'm right.
In your function LoadIconsAndTypesThread(), you don't free/destroy the
icon handle after the call to SHGetFileInfoA - since that API also
loads the overlay icons and applies them to the returned icon handle,
you of course get a memory leak.

I don't really know what exactly BoundsChecker tells you about the
memory leak, but I *know* that there is no such leak in the tsvn shell
dll.
Before you accuse others of bad coding, you really should first check
your own code.

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Wed May 23 10:31:40 2007

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