Segfault when removing widget containing flash content fixed.

preferencesAboutTextFull
Guillaume Burel 12 years ago
parent a80d2785c5
commit 880877aef2
  1. 7
      src/domain/UBGraphicsItemDelegate.cpp

@ -387,11 +387,16 @@ void UBGraphicsItemDelegate::remove(bool canUndo)
scene->removeItem(button); scene->removeItem(button);
scene->removeItem(mFrame); scene->removeItem(mFrame);
/* this is performed because when removing delegated from scene while it contains flash content, segfault happens because of QGraphicsScene::removeItem() */
UBGraphicsWebView *mDelegated_casted = static_cast<UBGraphicsWebView*>(mDelegated);
if (mDelegated_casted)
mDelegated_casted->setHtml(QString());
scene->removeItem(mDelegated); scene->removeItem(mDelegated);
if (canUndo) if (canUndo)
{ {
UBGraphicsItemUndoCommand *uc = new UBGraphicsItemUndoCommand((UBGraphicsScene*) scene, mDelegated, 0); UBGraphicsItemUndoCommand *uc = new UBGraphicsItemUndoCommand(scene, mDelegated, 0);
UBApplication::undoStack->push(uc); UBApplication::undoStack->push(uc);
} }
} }

Loading…
Cancel
Save