OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: commodore on September 17, 2021, 05:35:52 AM

Title: AutoCad crashes when closing form with red "X" if not in same doc
Post by: commodore on September 17, 2021, 05:35:52 AM
AutoCad 2022, OpenDcl 9.1.3.0 (also tried it with the stable build 9.0.6.1)
SDI = 0 (multi-document mode)

AutoCad crashes if the steps below are followed.
1. Open a drawing, let's call it DWG-A.
2. Open a OpenDCL Modeless form.
3. Open a new drawing, let's call it DWG-B.
4. Close DWG-A, leaving the form open.
5. Close the form using the Red "X" at the upper right of the form.

This causes AutoCad to crash.
This did not happen in AutoCad 2018 and OpenDCL 9.0.0.2
Title: Re: AutoCad crashes when closing form with red "X" if not in same doc
Post by: owenwengerd on September 21, 2021, 04:22:11 PM
I could not reproduce a crash using the Modeless demo form (OPENDCLDEMO) and following the provided steps. I tested with Acad 2022 _VERNUM=S.51.0.0.
Title: Re: AutoCad crashes when closing form with red "X" if not in same doc
Post by: commodore on September 28, 2021, 07:36:18 AM
We are using MEP 2022 with all the latest updates.
Windows 10, version 21H1.

See attached file.
Title: Re: AutoCad crashes when closing form with red "X" if not in same doc
Post by: owenwengerd on September 29, 2021, 07:13:43 PM
Did you try to reproduce it with the modeless form from the OPENDCLDEMO sample? If it crashes with the demo as well, it would indicate a generic issue; otherwise (and more likely) it is related to your system or code.
Title: Re: AutoCad crashes when closing form with red "X" if not in same doc
Post by: commodore on December 01, 2021, 10:14:52 AM
Owen,
I am able to reproduce the AutoCad crash using your "AllControls" sample.
See the attached video.
The crash seems to be caused by calls to "dcl-BlockView-PreLoadDwg" of which there are 2 in the "AllControls" sample.
If you comment out those 2 calls and repeat the process AutoCad does not crash.
Title: Re: AutoCad crashes when closing form with red "X" if not in same doc
Post by: owenwengerd on December 01, 2021, 09:15:05 PM
I am able to reproduce it now. The crash happens when a block from a preloaded drawing is displayed in a Block View control, then the control is destroyed after closing the document which was current at the time the drawing was preloaded. It looks like an Acad bug, and a thorny one to resolve.