lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




Am 01.04.2014 14:20 schrieb Kevin Martin:
On 1 Apr 2014, at 13:14, Moose <moose@posteo.de> wrote:
So even if the scripts cache all that, the DLL is still duplicate.

Surely, the OS won't physically load the dll twice, just increase the
reference count on the dll, so that two closes are required before it
is unloaded.

What's the harm of an increased reference count?

Surely, a OS would do that. But this is Windows here.
In similar cases in the past, I have observed that this really can happen and stumbled across legacy code that all of a sudden had duplicate singletons because of this. I am not entirely sure but I have reason to believe this is more than just a reference count. When I execute the script, for example, loading the DLL takes considerable time. It's quite a large application and pulls in a bunch of dependencies. It took at least 3 seconds executing the script I pasted into the picture. But you are right, I have not verified this. I will try to create a singleton in that DLL and access it from the script. Maybe I can compare the addresses and see if it really is two objects.

Cheers,
Moose