From 433efbc1151d0a22bf06f2836f59447b5cfc1dce Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 20 Sep 2015 16:59:17 +0200 Subject: [PATCH] + fix possible crash in debug mode --- src/Gui/BitmapFactory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gui/BitmapFactory.cpp b/src/Gui/BitmapFactory.cpp index 7d65b1423a..c0226ccf90 100644 --- a/src/Gui/BitmapFactory.cpp +++ b/src/Gui/BitmapFactory.cpp @@ -362,7 +362,11 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& contents, const QSize return QPixmap(); } frame->setContent(contents, QString::fromAscii("image/svg+xml")); - qApp->processEvents(); + // Important to exclude user events here because otherwise + // it may happen that an item the icon is created for gets + // deleted in the meantime. This happens e.g. dragging over + // the categories in the commands panel very quickly. + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); webPage.setViewportSize(webPage.mainFrame()->contentsSize()); double ww = webPage.viewportSize().width();