aboutsummaryrefslogtreecommitdiffstats
path: root/Lua
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-16 12:57:42 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-16 12:57:42 +0000
commit50b7732821d5f44ce6a1df17c1e7c5a3f639fc5e (patch)
tree09990382e369b01201e25f42733761965630e00f /Lua
parent4f292829106e62c7b6129b52ee6007e4f51259b8 (diff)
downloadusdx-50b7732821d5f44ce6a1df17c1e7c5a3f639fc5e.tar.gz
usdx-50b7732821d5f44ce6a1df17c1e7c5a3f639fc5e.tar.xz
usdx-50b7732821d5f44ce6a1df17c1e7c5a3f639fc5e.zip
fixed bug in UHookableEvent that caused a crash when owning plugin of last hook is unloaded
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1730 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Lua')
-rw-r--r--Lua/src/lua/UHookableEvent.pas9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lua/src/lua/UHookableEvent.pas b/Lua/src/lua/UHookableEvent.pas
index a3a87da6..de5a8a83 100644
--- a/Lua/src/lua/UHookableEvent.pas
+++ b/Lua/src/lua/UHookableEvent.pas
@@ -219,16 +219,19 @@ begin
While (Cur <> nil) do
begin
- If (Cur.Parent = Parent) then
+ if (Cur.Parent = Parent) then
begin //found a hook from parent => remove it
- If (Prev <> nil) then
+ if (Prev <> nil) then
Prev.Next := Cur.Next
Else
LastHook := Cur.Next;
Dispose(Cur);
- Cur := Prev.Next;
+ if (Prev <> nil) then
+ Cur := Prev.Next
+ else
+ Cur := LastHook;
end
else //move through the chain
begin