commontk / CTK

A set of common support code for medical imaging, surgical navigation, and related purposes.
https://commontk.org
Apache License 2.0
827 stars 480 forks source link

BUG: Fix Qt designer crash at startup #1190

Closed lassoan closed 4 months ago

lassoan commented 4 months ago

One of the DICOM widgets crashed the Qt designer because ctkDICOMScheduler::~ctkDICOMScheduler() called ctkJobScheduler::waitForDone, and that method called processEvents(). After returning form processEvents() the application crashed because the "this" pointer has become invalid (probably the ctkDICOMScheduler object got deleted).

Solved the issue by removing processEvents() from ctkJobScheduler::waitForDone, and instead calling processEvents() before calling ctkJobScheduler::waitForDone.

@Punzo please have a look and feel free to suggest a better design.

Punzo commented 4 months ago

It is good for me. It is strange that I did not experienced the Qt designer crashes on linux, anyway thanks for the fix!