Fixes second segmentation fault caused by use of qDeleteAll