View Revisions: Issue #36151

Summary 0036151: Access violation in Lazarus IDE when sparta_DockedFormEditor is installed and a unit with a frame is closed
Revision 2019-10-08 19:10 by Juha Manninen
Description Closing a unit with a Form seems to work.
Without sparta_DockedFormEditor there is no access violation.
For testing you must build Lazarus with debug flags on. I built it with: -gw -gl -godwarfsets -gh -gt -Co -Cr -Ci -Sa
I have tested on Linux with GTK2 and KDE5 bindings. It does not look like widgetset dependent.

I suppose the bug is related to the automatic memory management of interfaced objects like TFrameDesignerForm.
They get somehow wrongly freed. Such errors are nasty to debug and find.

Removing these lines:
- if LookupRoot is TControl then
- TControl(LookupRoot).RemoveAllHandlersOfObject(Self);
from destructor TFrameDesignerForm.Destroy changes the error. Then with GTK2 bindings I get:
  The program 'lazarus' received an X Window System error.
  This probably reflects a bug in the program.
  The error was 'BadWindow (invalid Window parameter)'.
    (Details: serial 286340 error_code 3 request_code 12 minor_code 0)
    (Note to programmers: normally, X errors are reported asynchronously;
     that is, you will receive the error a while after causing it.
     To debug your program, run it with the --sync command line
     option to change this behavior. You can then get a meaningful
     backtrace from your debugger if you break on the gdk_x_error() function.)

Revision 2019-10-08 18:55 by Juha Manninen
Description Closing a unit with a Form seems to work.
Without sparta_DockedFormEditor there is no access violation.
For testing you must build Lazarus with debug flags on. I built it with: -gw -gl -godwarfsets -gh -gt -Co -Cr -Ci -Sa
I have tested on Linux with GTK2 and KDE5 bindings. It does not look like widgetset dependent.