[Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread egodust
Heyas, When a compiled TCC binary image is memory linked, resolve_sym() is given the symbol to find, it looks for the assocated DLL (using DEF file info) and calls LoadLibrary(), using GetProcAddress() to get the function pointer. This is problematic: 1. LoadLibrary() is called, per symbol, if

Re: [Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread grischka
Can't you just store the DLL-handle into the DLLReference structure? --- grischka From: egodust Heyas, When a compiled TCC binary image is memory linked, resolve_sym() is given the symbol to find, it looks for the assocated DLL (using DEF file info) and calls LoadLibrary(), using

Re: [Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread egodust
I don't think you can, each dll name points back to the DLL (via index) that loaded it, I haven't investigated it fully yet though. On Mon, Apr 28, 2008 at 6:27 PM, grischka [EMAIL PROTECTED] wrote: Can't you just store the DLL-handle into the DLLReference structure? --- grischka From:

Re: [Tinycc-devel] tccpe.c / resolve_sym() leaks LoadLibrary() handles

2008-04-28 Thread egodust
Also, I think most people just use the tcc_run(), so it doesn't matter that LoadLibrary() is called incorrectly.. The way that importing/DLL usage on Win32 works with TCC is very limited at the moment anyway, if you want to use other DLLs you have to use LoadLibrary() from the TCC code, there