diff options
Diffstat (limited to '')
-rw-r--r-- | Lua/src/lua/UHookableEvent.pas | 9 |
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
|