The question now is, why is the window destroyed before the application exits?
Because in batch mode it is not needed anymore. The crash is due to the destruction of the log window before closing the workspace, as there is a call to ClearLog() in the workspace closing event.
Solutions:
- Use --no-batch-window-close in the command line call
- Destroy the window after closing the workspace, not before
- Use my patch in ticket 738
- Mark the window as destroyed and don't call ClearLog() if it is marked
- Remove the call to ClearLog() from the workspace closing event