forked from qt-creator/qt-creator
Vcs: Do not leak parameter widgets
Executing a parameter widget command calls a diff() or log() of VcsBaseClient. The editor already existed, but parameter widget is always created (call to setConfigurationWidget() will be ignored in this case) - and parameter widget gets leaked. Change-Id: I25591d5a54b80fed25ff11ce26108882c421e9fc Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Jarek Kobus
parent
5126f01fd6
commit
d558d077e2
@@ -357,10 +357,10 @@ void VcsBaseClient::diff(const QString &workingDir, const QStringList &files,
|
||||
vcsCmdString.toLatin1().constData(), id);
|
||||
editor->setWorkingDirectory(workingDir);
|
||||
|
||||
VcsBaseEditorParameterWidget *paramWidget = createDiffEditor(workingDir, files, extraOptions);
|
||||
if (paramWidget != 0) {
|
||||
connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)),
|
||||
paramWidget, SLOT(executeCommand()));
|
||||
VcsBaseEditorParameterWidget *paramWidget = editor->configurationWidget();
|
||||
if (!paramWidget && (paramWidget = createDiffEditor(workingDir, files, extraOptions))) {
|
||||
// editor has been just created, createVcsEditor() didn't set a configuration widget yet
|
||||
connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), paramWidget, SLOT(executeCommand()));
|
||||
editor->setConfigurationWidget(paramWidget);
|
||||
}
|
||||
|
||||
@@ -380,14 +380,15 @@ void VcsBaseClient::log(const QString &workingDir, const QStringList &files,
|
||||
const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files);
|
||||
const QString title = vcsEditorTitle(vcsCmdString, id);
|
||||
const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files);
|
||||
|
||||
VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true,
|
||||
vcsCmdString.toLatin1().constData(), id);
|
||||
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
|
||||
|
||||
VcsBaseEditorParameterWidget *paramWidget = createLogEditor(workingDir, files, extraOptions);
|
||||
if (paramWidget != 0)
|
||||
VcsBaseEditorParameterWidget *paramWidget = editor->configurationWidget();
|
||||
if (!paramWidget && (paramWidget = createLogEditor(workingDir, files, extraOptions))) {
|
||||
// editor has been just created, createVcsEditor() didn't set a configuration widget yet
|
||||
editor->setConfigurationWidget(paramWidget);
|
||||
}
|
||||
|
||||
QStringList args;
|
||||
const QStringList paramArgs = paramWidget != 0 ? paramWidget->arguments() : QStringList();
|
||||
|
||||
Reference in New Issue
Block a user