Skip to content

Commit e139d0f

Browse files
author
Joachim Marder
committed
Added possible fix for issue #39 (Occasional access violation in TUICommandCollection.Destroy() at program termination)
1 parent 45c64a8 commit e139d0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/UIRibbonCommands.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3757,8 +3757,8 @@ destructor TUICollection.Destroy;
37573757
begin
37583758
{ The ribbon takes additional ownership of the collection, so we must
37593759
release it to avoid a memory leak. See issue #34 }
3760-
while FHandle._Release() > 1 do;
3761-
FHandle := nil;
3760+
while FHandle._Release() > 0 do;
3761+
Pointer(FHandle) := nil; // Set to nil without decreasing ref count, this was done the line before. See issue #39
37623762
Inherited;
37633763
end;
37643764

0 commit comments

Comments
 (0)