Segfault when removing widget containing flash content fixed.

preferencesAboutTextFull
Guillaume Burel 13 years ago
parent a80d2785c5
commit 880877aef2
  1. 9
      src/domain/UBGraphicsItemDelegate.cpp
  2. 2
      src/domain/UBGraphicsWebView.cpp

@ -387,14 +387,19 @@ void UBGraphicsItemDelegate::remove(bool canUndo)
scene->removeItem(button);
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);
if (canUndo)
{
UBGraphicsItemUndoCommand *uc = new UBGraphicsItemUndoCommand((UBGraphicsScene*) scene, mDelegated, 0);
UBGraphicsItemUndoCommand *uc = new UBGraphicsItemUndoCommand(scene, mDelegated, 0);
UBApplication::undoStack->push(uc);
}
}
}
}

@ -30,7 +30,7 @@ UBGraphicsWebView::UBGraphicsWebView(QGraphicsItem* parent) :
{
setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);
mDelegate = new UBGraphicsItemDelegate(this,0, true, false, false);
mDelegate = new UBGraphicsItemDelegate(this, 0, true, false, false);
mDelegate->init();
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);

Loading…
Cancel
Save