dladdr and dll refcount

Jon Turney jon.turney@dronecode.org.uk
Sat Apr 5 13:51:37 GMT 2025


On 05/04/2025 06:28, Jeremy Drake via Cygwin wrote:
> I just happened to look at dlfcn.cc dladdr function, and I had a question.
> Should dladdr be using the GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
> flag? It doesn't seem like dladdr should be incrementing the refcount.

Indeed. Well spotted.
This looks like my mistake back in commit 
c8432a01c8401c121940c806a9d868c4adc4cefd
Assuming that flag is available on all applicable Windows versions, it 
certainly looks like we should be using it (otherwise, I guess we just 
immediately free the handle).


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /