supermerill / SuperSlicer

G-code generator for 3D printers (Prusa, Voron, Creality, etc.)
4.05k stars 515 forks source link

fix NULL dereference on wxWidgets 3.2 #4077

Closed Icenowy closed 5 months ago

Icenowy commented 5 months ago

According to the document of wxWidgets, the initializer of wxLocale with no parameters do not do any initialization at all, thus do not register its wxTranslations.

Explicitly call Init() with its default parameters to init it with the default setting, otherwise on Linux with wxWidgets 3.2, the wxTranslations singleton get is NULL and lead to NULL deference.

The code here is from PrusaSlicer 2.5 [1].

[1] https://github.com/prusa3d/PrusaSlicer/commit/e21921f2ebd2b94c57459bd280f1b1bd8eec1b9c

supermerill commented 5 months ago

Merge in my dev branch. Will be in next nightly & release Thanks for he fix.