- fix: crash when closing the options dialog under Ubuntu 20.04 LTS ( no memory leak now)
This commit is contained in:
parent
9ea32df675
commit
e30fa7bc0c
|
@ -19,16 +19,6 @@ DEFINES += PREFIX=\\\"$${PREFIX}\\\"
|
||||||
DEFINES += APP_NAME=\\\"$${APP_NAME}\\\"
|
DEFINES += APP_NAME=\\\"$${APP_NAME}\\\"
|
||||||
DEFINES += REDPANDA_CPP_VERSION=\\\"$${APP_VERSION}\\\"
|
DEFINES += REDPANDA_CPP_VERSION=\\\"$${APP_VERSION}\\\"
|
||||||
|
|
||||||
linux: {
|
|
||||||
LINUX_DISTRO = $$system(cat /etc/issue)
|
|
||||||
contains(LINUX_DISTRO, .*Ubuntu.*){
|
|
||||||
contains(LINUX_DISTRO, .*20\.04.*) {
|
|
||||||
message("Found Ubuntu 20.04")
|
|
||||||
DEFINES += SETTINGS_DIALOG_FIX
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gcc {
|
gcc {
|
||||||
QMAKE_CXXFLAGS_RELEASE += -Werror=return-type
|
QMAKE_CXXFLAGS_RELEASE += -Werror=return-type
|
||||||
QMAKE_CXXFLAGS_DEBUG += -Werror=return-type
|
QMAKE_CXXFLAGS_DEBUG += -Werror=return-type
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
|
* Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -183,14 +183,14 @@ Editor::Editor(QWidget *parent, const QString& filename,
|
||||||
}
|
}
|
||||||
|
|
||||||
Editor::~Editor() {
|
Editor::~Editor() {
|
||||||
pMainWindow->fileSystemWatcher()->removePath(mFilename);
|
if (mParentPageControl) {
|
||||||
pMainWindow->caretList().removeEditor(this);
|
pMainWindow->fileSystemWatcher()->removePath(mFilename);
|
||||||
pMainWindow->updateCaretActions();
|
pMainWindow->caretList().removeEditor(this);
|
||||||
if (mParentPageControl!=nullptr) {
|
pMainWindow->updateCaretActions();
|
||||||
int index = mParentPageControl->indexOf(this);
|
int index = mParentPageControl->indexOf(this);
|
||||||
mParentPageControl->removeTab(index);
|
mParentPageControl->removeTab(index);
|
||||||
|
this->setParent(nullptr);
|
||||||
}
|
}
|
||||||
this->setParent(nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::loadFile(QString filename) {
|
void Editor::loadFile(QString filename) {
|
||||||
|
@ -1522,7 +1522,7 @@ void Editor::onStatusChanged(SynStatusChanges changes)
|
||||||
|
|
||||||
pMainWindow->updateEditorActions();
|
pMainWindow->updateEditorActions();
|
||||||
|
|
||||||
if (changes.testFlag(SynStatusChange::scCaretY)) {
|
if (changes.testFlag(SynStatusChange::scCaretY) && mParentPageControl) {
|
||||||
pMainWindow->caretList().addCaret(this,caretY(),caretX());
|
pMainWindow->caretList().addCaret(this,caretY(),caretX());
|
||||||
pMainWindow->updateCaretActions();
|
pMainWindow->updateCaretActions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,13 +88,6 @@ SettingsDialog::~SettingsDialog()
|
||||||
{
|
{
|
||||||
for (SettingsWidget* p:mSettingWidgets) {
|
for (SettingsWidget* p:mSettingWidgets) {
|
||||||
p->setParent(nullptr);
|
p->setParent(nullptr);
|
||||||
//dirty fix for ubuntu 20.04 LTS
|
|
||||||
#ifdef SETTINGS_DIALOG_FIX
|
|
||||||
if (p->group()==tr("Editor") && p->name()==tr("Color"))
|
|
||||||
continue;
|
|
||||||
if (p->group()==tr("Editor") && p->name()==tr("Snippet"))
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
delete ui;
|
delete ui;
|
||||||
|
@ -152,12 +145,11 @@ PSettingsDialog SettingsDialog::optionDialog()
|
||||||
dialog->addWidget(widget);
|
dialog->addWidget(widget);
|
||||||
|
|
||||||
widget = new EnvironmentFoldersWidget(tr("Folders"),tr("Environment"));
|
widget = new EnvironmentFoldersWidget(tr("Folders"),tr("Environment"));
|
||||||
dialog->addWidget(widget);
|
|
||||||
|
|
||||||
connect((EnvironmentFoldersWidget*)widget,
|
connect((EnvironmentFoldersWidget*)widget,
|
||||||
&EnvironmentFoldersWidget::shouldQuitApp,
|
&EnvironmentFoldersWidget::shouldQuitApp,
|
||||||
dialog.get(),
|
dialog.get(),
|
||||||
&SettingsDialog::closeAndQuit);
|
&SettingsDialog::closeAndQuit);
|
||||||
|
dialog->addWidget(widget);
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
widget = new EnvironmentProgramsWidget(tr("Terminal"),tr("Environment"));
|
widget = new EnvironmentProgramsWidget(tr("Terminal"),tr("Environment"));
|
||||||
|
|
Loading…
Reference in New Issue