mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline OP
Hoopy frood
OP Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Usually I leave doc issues alone but this one is highly misleading and can lead to some rather serious (GPF) / very-hard-to-debug / very-hard-to-find bugs in dlls given that it's not obvious at all:

the UnloadDll function documents that mTimeout can take on only two values, quote:

Originally Posted By: mirc.hlp

The mTimeout value can be:

0 UnloadDll() is being called due to a DLL being unloaded when mIRC exits, or unloaded with /dll -u.

1 UnloadDll() is being called due to a DLL not being used for ten minutes. The UnloadDll() routine can return 0 to keep the DLL loaded, or 1 to allow it to be unloaded.


This is not true. It should read:

Originally Posted By: mirc.hlp

The mTimeout value can be:

0 UnloadDll() is being called due to a DLL being unloaded with /dll -u.

1 UnloadDll() is being called due to a DLL not being used for ten minutes. The UnloadDll() routine can return 0 to keep the DLL loaded, or 1 to allow it to be unloaded.

2 UnloadDll() is being called to to a DLL being unloaded when mIRC exits.


Note that the return value of 2 is completely omitted, which can cause developers to mishandle their cleanup routines. Not unhooking mIRC windows before exiting mIRC, for instance, can cause mIRC to crash when exiting, and this will easily be missed if the programmer handles exit as mTimeout=0 and not the true value of mTimeout=2.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2002
Posts: 5,524
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,524
Thanks the help file has been updated for the next version.


Link Copied to Clipboard