Fix - HistoryWidget is not deleted in Controller
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user