mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Plugins: Set plugin as parent for all created actions
This fixes crash on Windows when unloading plugin and then showing a menu where the plugin action was. There is still crash on exit in that case.
This commit is contained in:
parent
e375a9b520
commit
176b31198e
@ -116,7 +116,6 @@ void TabManagerPlugin::populateExtensionsMenu(QMenu* menu)
|
||||
{
|
||||
if (viewType() == ShowAsWindow) {
|
||||
QAction* showAction = m_controller->createMenuAction();
|
||||
showAction->setParent(menu);
|
||||
showAction->setCheckable(false);
|
||||
connect(showAction, SIGNAL(triggered()), m_controller, SLOT(raiseTabManager()));
|
||||
menu->addAction(showAction);
|
||||
|
@ -48,7 +48,7 @@ QString TabManagerWidgetController::title() const
|
||||
|
||||
QAction* TabManagerWidgetController::createMenuAction()
|
||||
{
|
||||
QAction* act = new QAction(tr("Tab Manager"), 0);
|
||||
QAction* act = new QAction(tr("Tab Manager"), this);
|
||||
act->setCheckable(true);
|
||||
act->setIcon(QIcon(":tabmanager/data/tabmanager.png"));
|
||||
act->setShortcut(QKeySequence("Ctrl+Shift+M"));
|
||||
|
@ -34,7 +34,10 @@ QString TestPlugin_Sidebar::title() const
|
||||
|
||||
QAction* TestPlugin_Sidebar::createMenuAction()
|
||||
{
|
||||
QAction* act = new QAction(tr("Testing Sidebar"), 0);
|
||||
// The action must be parented to some object from plugin, otherwise
|
||||
// there may be a crash when unloading the plugin.
|
||||
|
||||
QAction* act = new QAction(tr("Testing Sidebar"), this);
|
||||
act->setCheckable(true);
|
||||
|
||||
return act;
|
||||
|
Loading…
Reference in New Issue
Block a user