- fix: Crash if close file while auto syntax checking.
This commit is contained in:
parent
496421e97d
commit
f462d6708d
1
NEWS.md
1
NEWS.md
|
@ -26,6 +26,7 @@ Red Panda C++ Version 2.24
|
|||
- fix: When opening multiple files, only the active file should be parsed.
|
||||
- fix: Wrong compiler settings if xcode is not installed in mac os.
|
||||
- enhancement: Name for new files will not be different from files openned.
|
||||
- fix: Crash if close file while auto syntax checking.
|
||||
|
||||
Red Panda C++ Version 2.23
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ QString Compiler::getCharsetArgument(const QByteArray& encoding,FileType fileTyp
|
|||
// test if force utf8 from autolink infos
|
||||
if ((fileType == FileType::CSource ||
|
||||
fileType == FileType::CppSource) && pSettings->editor().enableAutolink() ){
|
||||
Editor* editor = pMainWindow->editorList()->getEditor();
|
||||
Editor* editor = pMainWindow->editorList()->getOpenedEditorByFilename(mFilename);
|
||||
if (editor) {
|
||||
PCppParser parser = editor->parser();
|
||||
if (parser) {
|
||||
|
@ -340,7 +340,7 @@ QString Compiler::getCharsetArgument(const QByteArray& encoding,FileType fileTyp
|
|||
}
|
||||
QSet<QString> parsedFiles;
|
||||
forceExecUTF8 = parseForceUTF8ForAutolink(
|
||||
editor->filename(),
|
||||
mFilename,
|
||||
parsedFiles,
|
||||
parser);
|
||||
}
|
||||
|
|
|
@ -192,6 +192,7 @@ Editor::Editor(QWidget *parent, const QString& filename,
|
|||
|
||||
mStatementColors = pMainWindow->statementColors();
|
||||
if (mParentPageControl) {
|
||||
//first showEvent triggered here
|
||||
mParentPageControl->addTab(this,"");
|
||||
updateCaption();
|
||||
}
|
||||
|
@ -217,12 +218,13 @@ Editor::Editor(QWidget *parent, const QString& filename,
|
|||
this, &Editor::onScrollBarValueChanged);
|
||||
mInited=true;
|
||||
|
||||
// if (!pMainWindow->openingFiles()
|
||||
// && !pMainWindow->openingProject()) {
|
||||
// reparse(false);
|
||||
// checkSyntaxInBack();
|
||||
// reparseTodo();
|
||||
// }
|
||||
//show event is trigged when this is added to the qtabwidget
|
||||
if (!pMainWindow->openingFiles()
|
||||
&& !pMainWindow->openingProject()) {
|
||||
reparse(false);
|
||||
checkSyntaxInBack();
|
||||
reparseTodo();
|
||||
}
|
||||
}
|
||||
|
||||
Editor::~Editor() {
|
||||
|
@ -3106,7 +3108,7 @@ void Editor::reparse(bool resetParser)
|
|||
return;
|
||||
if (!mParser->enabled())
|
||||
return;
|
||||
|
||||
//qDebug()<<"reparse "<<mFilename;
|
||||
//mParser->setEnabled(pSettings->codeCompletion().enabled());
|
||||
ParserLanguage language = mUseCppSyntax?ParserLanguage::CPlusPlus:ParserLanguage::C;
|
||||
if (!inProject()) {
|
||||
|
|
|
@ -66,6 +66,7 @@ CppParser::CppParser(QObject *parent) : QObject(parent)
|
|||
|
||||
CppParser::~CppParser()
|
||||
{
|
||||
//qDebug()<<"delete parser";
|
||||
while (true) {
|
||||
//wait for all methods finishes running
|
||||
{
|
||||
|
@ -75,6 +76,7 @@ CppParser::~CppParser()
|
|||
break;
|
||||
}
|
||||
}
|
||||
//qDebug()<<"waiting for parse finished";
|
||||
QThread::msleep(50);
|
||||
QCoreApplication* app = QApplication::instance();
|
||||
app->processEvents();
|
||||
|
|
Loading…
Reference in New Issue