summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMathias Kinzler2010-03-16 06:35:40 (EDT)
committer Mathias Kinzler2010-04-01 07:01:58 (EDT)
commit0347bbf8ebc36b495916cd5199f58850bd8d92cf (patch)
tree8e2a1243632db765947872ef94ab540b4335aa36
parent77beda4de51a204507a4e22dd01fff4172919e33 (diff)
downloadegit-0347bbf8ebc36b495916cd5199f58850bd8d92cf.zip
egit-0347bbf8ebc36b495916cd5199f58850bd8d92cf.tar.gz
egit-0347bbf8ebc36b495916cd5199f58850bd8d92cf.tar.bz2
NPE during Eclipse shutdownrefs/changes/53/353/3
Make the "traceVerbose" flag static and set it during start() and stop(). Bug: 304799 Change-Id: I48bfd339f934a396e35a567f5e8efb5ddc9adbfe Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
index 3d18d88..cd9d270 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
@@ -282,6 +282,12 @@ public class Activator extends AbstractUIPlugin {
// FIXME, need to be more intelligent about this to avoid too much work
private static final long REPO_SCAN_INTERVAL = 10000L;
+ // volatile in order to ensure thread synchronization
+ private volatile boolean doReschedule = true;
+
+ void setReschedule(boolean reschedule){
+ doReschedule = reschedule;
+ }
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -323,7 +329,8 @@ public class Activator extends AbstractUIPlugin {
GitTraceLocation.getTrace().trace(
GitTraceLocation.UI.getLocation(),
"Rescheduling " + getName() + " job"); //$NON-NLS-1$ //$NON-NLS-2$
- schedule(REPO_SCAN_INTERVAL);
+ if (doReschedule)
+ schedule(REPO_SCAN_INTERVAL);
} catch (Exception e) {
// TODO is this the right location?
if (GitTraceLocation.UI.isActive())
@@ -369,10 +376,14 @@ public class Activator extends AbstractUIPlugin {
}
public void stop(final BundleContext context) throws Exception {
+
if (GitTraceLocation.UI.isActive())
GitTraceLocation.getTrace().trace(
GitTraceLocation.UI.getLocation(),
"Trying to cancel " + rcs.getName() + " job"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ rcs.setReschedule(false);
+
rcs.cancel();
if (GitTraceLocation.UI.isActive())
GitTraceLocation.getTrace().trace(
@@ -386,6 +397,7 @@ public class Activator extends AbstractUIPlugin {
if (GitTraceLocation.UI.isActive())
GitTraceLocation.getTrace().trace(
GitTraceLocation.UI.getLocation(), "Jobs terminated"); //$NON-NLS-1$
+
super.stop(context);
plugin = null;
}