Diffusion Krita 415de56a5df5

Refractor into slotImportResource()

Authored by anikethgirish on Aug 9 2017, 6:46 PM.

Description

Refractor into slotImportResource()

Details

Committed
anikethgirishAug 9 2017, 6:46 PM
Parents
R37:84e673a5abe3: Fix issue
Branches
Unknown
Tags
Unknown
rempt added a subscriber: rempt.Aug 10 2017, 11:32 AM

This leaks memory: every time the button is pressed, a new menu is created. The old one isn't deleted. It should be enough to create the menu in the constructor and set it on the button. You will also need a a destructor, to delete the menu:

DlgBundleManager::~DlgBundleManager()
{

delete(m_ui->m_importResources->menu());

}

Check the documentation of QPushButton: http://doc.qt.io/qt-5/qpushbutton.html#setMenu

/plugins/extensions/resourcemanager/dlg_bundle_manager.cpp
91

Here you should create the menu and set it on the button

98

This is not needed: if the menu is set on the button it will open.

342

This whole method is not needed.