Recent

Author Topic: Docking with TAChart  (Read 988 times)

kapibara

  • Hero Member
  • *****
  • Posts: 610
Docking with TAChart
« on: January 29, 2023, 05:37:20 pm »
Closing the application results in a SIGSEG if there is a docked form with a chart inside, but not with other controls like a TMemo.

I tried undocking before closing the app and also freeing the form with the chart but there is still a crash when closing. Press the button in the demo and close the app to reproduce.
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Docking with TAChart
« Reply #1 on: January 29, 2023, 05:50:12 pm »
The second form you create does not have an owner which seem to cause your issue.

PS: you have the auto create for form2 in your project options as well (that can be removed as per your example).
« Last Edit: January 29, 2023, 05:55:56 pm by TRon »

kapibara

  • Hero Member
  • *****
  • Posts: 610
Re: Docking with TAChart
« Reply #2 on: January 29, 2023, 06:34:49 pm »
You are right, with an Owner instead of NIL it just works.

(I forgot to remove form2 from autocreate,  this was a quick demo broken out from another app)
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Docking with TAChart
« Reply #3 on: January 29, 2023, 07:03:29 pm »
You are right, with an Owner instead of NIL it just works.
for the record it does work when you do not provide an owner (e.g. nil) but ... you still need to keep track of your forms so that you can properly destroy them.

The reason you get the access violation is triggered by the destruction of your main form/application. Then the forms without owner will be somewhere located in the twilight-zone (which seem to trigger the access violation)

Quote
(I forgot to remove form2 from autocreate,  this was a quick demo broken out from another app)
Understood. I just mentioned it in case you did not realize.

 

TinyPortal © 2005-2018