KeyWorksRW / wxUiEditor

RAD tool used to create and maintain wxWidgets UI elements.
Apache License 2.0
61 stars 6 forks source link

Change filename to varname algorithm, add try/catch blocks around image processing thread #1419

Closed Randalphwa closed 5 months ago

Randalphwa commented 5 months ago

The main focus of this PR is to change the filename to varname conversion. I encountered a situation where the entire filename was UTF8, and conversion failed completely, creating a varname of _svg. Part os this was due to wxString::Format, but even fixing that resulted in tripling the varname instead of the expected doubling. The new algorithm solves makes the varname a bit shorter, and also solves the UTF8 issue. The name is unique, but for UTF8, it will off course bear no resemblance to the original filename.

The second part of this PR adds try/catch around thrd_collect_img_headers.join(); -- I'm running into a crash in the thread. This won't solve the crash, but should help to find the source of the problem. Once found, it still makes sense to leave the try/catch in place since it won't have any noticeable effect on performance.