I suspect that the callback is being called concurrently and crashing slicer by calling processEvents concurrently. If I use a mutex for preventing the call to processEvents by more than one thread, it works.
If you call processEvents() inside an event handler, you may get into infinite recursion (and there might be other issues), so don’t do it.
Since ctkDICOMIndexer can run in non-blocking mode (set indexer.backgroundImportEnabled=True), it is not necessary to call slicer.app.processEvents() at all. If the main thread is not blocked then all events are processed automatically. You can use the application while the import in the background is running; or show a popup window to block the user from wandering away.
You may also use the DICOM module’s indexer, which shows the progress in the DICOM browser and does not block the application at all (as it is done in this test/example).