Sign in to follow this  
Followers 0
Myicq

Remove DLL (FreeImage)

4 posts in this topic

I have developed a small application using FreeImage DLL. I enclose the DLL inside the compiled EXE, so that the DLL is written to @ScriptDir if it is not there already.

That part works just fine.

My problem is at program exit. I would like to clean up nicely.

I have tried the following

Case $btnEXIT
    if FileExists(@ScriptDir & "\FreeImage.dll") Then
    _FreeImage_DeInitialise()
    _FreeImage_UnLoadDLL()      ; UNLOAD THE DLL
    Sleep(1000)
    FileDelete(@ScriptDir & "\FreeImage.dll")
    EndIf
    Exit

but the DLL is still there at program exit.

I assume that the DLL is somehow locked by FreeImage or the program, alas a catch-22.

Any hints ?


I am just a hobby programmer, and nothing great to publish right now.

Share this post


Link to post
Share on other sites



You should know if you have it locked, it's your responsibility to know what your code does. Check one more time unloading and loading functions. You have a leak of handles.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Oops, small bug in _FreeImage_UnLoadDLL() :unsure: I used a wrong variable in DLLClose (refcount instead of handle)

PS: I'm updating the UDF, also adding about 50 new functions of new FreeImage release.

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

You should know if you have it locked, it's your responsibility to know what your code does.

Ehh excuseme, that is exactly what I tried to keep track of. And actually turned out to be UDF with a small typo. So treat me gently :unsure:


I am just a hobby programmer, and nothing great to publish right now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0