stringFormat can crash application on shutdown
Posted: 25 Feb 2021 21:27
CAVEAT: I'm on build 904 due to some of the 64-bit issues on build 906, so will say I have not tried this on build 906.
Just reporting the strangest issue I ran into in NADYA3 chess, but can reproduce easily enough in a fresh SDI GUI application. I wanted to reuse the same "stringFormat" in my object so created it in the constructor of a custom control. Oddly if you simply start the application, then hit the "close" button, the application crashes with an Access Violation. I resolved my issue by just creating the "stringFormat" in the predicate when I need it.
Here are two lines added to a SDI fresh application to reproduce the problem:
Thank,
Craig Hoibakk
Just reporting the strangest issue I ran into in NADYA3 chess, but can reproduce easily enough in a fresh SDI GUI application. I wanted to reuse the same "stringFormat" in my object so created it in the constructor of a custom control. Oddly if you simply start the application, then hit the "close" button, the application crashes with an Access Violation. I resolved my issue by just creating the "stringFormat" in the predicate when I need it.
Here are two lines added to a SDI fresh application to reproduce the problem:
Code: Select all
implement mainForm inherits formWindow
open core, vpiDomains, ribbonControl
facts
string_format_ : stringFormat := erroneous. % <---- HERE
clauses
display(Parent) = Form :-
Form = new(Parent),
Form:show().
constructors
new : (window Parent).
clauses
new(Parent) :-
formWindow::new(Parent),
generatedInitialize(),
stdio::outputStream := messageControl_ctl:outputStream,
createCommands(),
ribbonControl_ctl:layout := layout,
setGetNavigationPointsResponder(ribbonControl_ctl:getNavigationPoints),
navigationOverlay::registerSDI(This),
textStatusCell := statusBarCell::new(statusBarControl_ctl, 30),
statusBarControl_ctl:cells := [textStatusCell],
% If I enable the next line, the program crashes when you close it.
string_format_ := stringFormat::create(). % <---- HERE
Craig Hoibakk