[plugins] delHook(s) and other stuff

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

[plugins] delHook(s) and other stuff

#1 Post by Technology »

I think we need to do this:

Code: Select all

Index: Plugins.pm
===================================================================
--- Plugins.pm	(revision 7094)
+++ Plugins.pm	(working copy)
@@ -393,6 +393,7 @@
 		foreach my $singleHandle (@{$handle}) {
 			delHook($singleHandle);
 		}
+		undef @{$handle};
 
 	} elsif (isa($handle, 'Plugins::HookHandle') && defined $handle->[HOOKNAME]) {
 		my $hookName = quarkToString($handle->[HOOKNAME]);
@@ -403,6 +404,7 @@
 		}
 		delete $handle->[HOOKNAME];
 		delete $handle->[INDEX];
+		undef $handle;
 
 		if ($hookList && $hookList->size() == 0) {
 			delete $hooks{$hookName};
look what hack i had to pull off to check if the array of hooks weren't already deleted:
https://openkore.svn.sourceforge.net/sv ... amefort.pl
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: [plugins] delHook(s)

#2 Post by kali »

Hm, could this also contribute to possible memory leaks if you reload plugins over and over?
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: [plugins] delHook(s)

#3 Post by Technology »

some other fixes (and rewrite of selective plugin loading)
You do not have the required permissions to view the files attached to this post.
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: [plugins] delHook(s) and other stuff

#4 Post by Technology »

just noticed, this was missing

Code: Select all

$condition = \&c_loadAll;
under

Code: Select all

message T("Loading all plugins (by default)...\n", 'plugins');
commit?
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: [plugins] delHook(s) and other stuff

#5 Post by kLabMouse »

If code is checked and rechecked, and working fine. Then just commit.
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: [plugins] delHook(s) and other stuff

#6 Post by Technology »

tested by me and comitted
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!