Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread EDB and Delphi12
Mon, Feb 19 2024 2:38 PMPermanent Link

Heiko Knuettel

Hi,

every few years I update the IDE and all components, just did so from 10.2 to 12. And of course...

I have several occurrences of e.g.

procedure EDBTableOnAfterScroll(...
begin
  do something with ControlX on the form
end

which now throw access violations when I close the form, because they are executed when ControlX has already been destroyed.

I've never given this much thought, how does Delphi decide in which order to destroy components? Why did this magically work until now?

Anybody has an idea about this? Thanks in advance!

Heiko
Tue, Feb 20 2024 9:51 AMPermanent Link

Heiko Knuettel

It seems Delphi 12 does something different now when it comes to closing forms. It also doesn't seem to happen on every form - what's the difference between them I haven't found out.

I solved it for me by setting onAfterScroll to nil before form close, which was easy to do since I (thankfully) subclassed TForm.
Image