Painter 12.1.2 crashes on exit when the open project uses Adobe ACE color management
Version: Substance 3D Painter 12.1.2 (build 5641, Windows, Vulkan)
OS: Windows 11
Steps to reproduce
- Create a new project with Color management set to "Adobe ACE - ICC".
- Save the project.
- Close Painter with the project still open.
Result
Painter crashes during shutdown and the crash report window appears. It happens on every exit. It does not happen when no project is open, or when the project uses Legacy color management. Reproduced with all third-party plugins disabled.
Crash details
Access violation (0xC0000005) reading freed memory in ACE.dll+0x24715, on the main thread, while the main window is being destroyed:
main> Alg::S4GuiApplication_ destructor> Alg::S4MainWindow destructor> Alg::MainWidget destructor> ... (PaintEditorToolBar children)> Alg::ToolBarSourceColorPickerView destructor> Alg::GrayScaleButton destructor> Alg::ColorManagement::ACEColorSpaceTransform destructor> ACE.dll (transform unreference) <- crash
The ACEColorSpaceTransform held by the toolbar's GrayScaleButton is released after the ACE transform it refers to has already been freed earlier in the shutdown sequence, so the handle passed to ACE is dangling.
Workaround
Deleting the Alg::ToolBarSourceColorPickerView widget after QCoreApplication::aboutToQuit and before the main window is destroyed (while the transform is still valid) makes Painter exit cleanly.
I can provide the minidump on request.
