From b13164d3bb1b6269f216a06712ffbb17acca7e68 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Thu, 20 Nov 2014 19:38:55 +0300 Subject: [PATCH] Already disposed fixed in HgRepository --- .../src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java index 6203f259b9bc..94860b9361b7 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java @@ -196,9 +196,10 @@ public class HgRepositoryImpl extends RepositoryImpl implements HgRepository { HgRepoInfo currentInfo = readRepoInfo(); // update only if something changed!!! if update every time - new log will be refreshed every time, too. // Then blinking and do not work properly; - if (!Disposer.isDisposed(getProject()) && !currentInfo.equals(myInfo)) { + Project project = getProject(); + if (!project.isDisposed() && !currentInfo.equals(myInfo)) { myInfo = currentInfo; - HgCommandResult branchCommandResult = new HgBranchesCommand(getProject(), getRoot()).collectBranches(); + HgCommandResult branchCommandResult = new HgBranchesCommand(project, getRoot()).collectBranches(); if (branchCommandResult == null || branchCommandResult.getExitValue() != 0) { LOG.warn("Could not collect hg opened branches."); // hg executable is not valid myOpenedBranches = myInfo.getBranches().keySet(); @@ -206,7 +207,9 @@ public class HgRepositoryImpl extends RepositoryImpl implements HgRepository { else { myOpenedBranches = HgBranchesCommand.collectNames(branchCommandResult); } - getProject().getMessageBus().syncPublisher(HgVcs.STATUS_TOPIC).update(getProject(), getRoot()); + if (!project.isDisposed()) { + project.getMessageBus().syncPublisher(HgVcs.STATUS_TOPIC).update(project, getRoot()); + } } }