Fix - HistoryWidget is not deleted in Controller

This commit is contained in:
Yuriy Puchkov
2020-10-16 10:17:29 +03:00
parent 8e25f438f2
commit 161ecc3c04
2 changed files with 16 additions and 3 deletions

View File

@@ -44,6 +44,8 @@
Controller::Controller()
: m_captureWindow(nullptr)
{
m_history = nullptr;
qApp->setQuitOnLastWindowClosed(false);
// set default shortcusts if not set yet
@@ -68,6 +70,11 @@ Controller::Controller()
qApp->setStyleSheet(StyleSheet);
}
Controller::~Controller()
{
delete m_history;
}
Controller* Controller::getInstance()
{
static Controller c;
@@ -297,9 +304,11 @@ void Controller::updateConfigComponents()
void Controller::showRecentScreenshots()
{
HistoryWidget* pHistory = new HistoryWidget();
pHistory->loadHistory();
pHistory->exec();
if (nullptr == m_history) {
m_history = new HistoryWidget();
}
m_history->loadHistory();
m_history->show();
}
void Controller::startFullscreenCapture(const uint id)