mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2008
Posts: 6
H
high6 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Jul 2008
Posts: 6
Version: 6.21

I have come across a problem with keeping a plugin loaded.

The plugin stays loaded after the first call but then after about 10 minutes of not calling the dll, mirc crashes and I noticed when debugging the crash that the plugin isn't loaded when it crashes.

So I think what is happening is mirc still sees the dll as being loaded but for some reason the dll is unloaded so when tries to access it it has a memory access violation because the dll isn't there anymore.

Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
Try updating to 6.32 then see if the problem occurs.


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Jan 2006
Posts: 468
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
Which DLL was that? Please elaborate accurately explaining what did you do, which DLL, your operating system and version etc...

AND what Jigsy said too!

Last edited by symphony; 17/07/08 11:39 PM.
Joined: Jul 2008
Posts: 6
H
high6 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Jul 2008
Posts: 6
Got 6.32, same thing.

Last edited by high6; 18/07/08 02:10 AM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
If a DLL isn't used for ten minutes mIRC will attempt to unload it. A DLL can prevent itself from being unloaded by defining an UnloadDll() function and checking the parameter passed to it has a value of 1. Most likely the DLL is interacting with either mIRC or another DLL in such a way that unloading it is causing the crash. You should contact the DLL author to ensure they are accounting for mIRC's "timeout" behaviour.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Or else the guy could set a 9 minute timer to call one of the dll's minor functions to keep it from timing out, assuming it's exactly 10 minutes and not an approximation.

Joined: Jul 2008
Posts: 6
H
high6 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Jul 2008
Posts: 6
That fixed it, still kinda seems silly that after it unloads the dll it still thinks it has it and tries to access it without reloading it.

Also kinda stupid that it unloads it after a timeout. I think if you set Keep to true I think you maybe don't want it unloaded after 10 minutes...

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Originally Posted By: high6
That fixed it, still kinda seems silly that after it unloads the dll it still thinks it has it and tries to access it without reloading it.

That would be silly, which is why mIRC doesn't do it.

Your DLL is likely doing something that results in it being called upon by Windows or another external application (subclassing a window, for example). Your DLL should clean these things up when it's being unloaded.

You seem very eager to blame mIRC for what is very likely your own bad coding.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
It can't "reload it" because "it" doesn't know what was loaded to begin with. It's gone. As Collective mentioned, the Dll developer is responsible for cleanup, mIRC has no way of knowing what was left behind.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2008
Posts: 6
H
high6 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
H
Joined: Jul 2008
Posts: 6
I am guessing that when you don't have UnloadDll defined it just unloads it but because of Keep in LoadDll it still thinks its loaded when it's not.

Last edited by high6; 19/07/08 03:50 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
No.. mIRC doesn't think its loaded. Whatever process/subroutines the dll initiated will stick around though, because mIRC isn't responsible for cleaning them up.. those subroutines will assume the parent is still loaded, when it's not... that's what you meant to say. Of course, that's not mIRC's fault/problem, it's the dll author's

/help Dll Support and read Unloading a Dll. When a dll times out, mIRC unloads it and knows that it unloaded it. That's why this is not a bug. It's intentional.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard