Skip to content

Commit 50a4f1a

Browse files
committed
Avoid creating an agent manager during bundle stop
- If the agent isn't already created we don't need to dispose it and trying to create it fails. eclipse-platform/eclipse.platform#2211
1 parent 34c4b20 commit 50a4f1a

File tree

1 file changed

+6
-2
lines changed
  • plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core

1 file changed

+6
-2
lines changed

plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/P2CorePlugin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
package org.eclipse.oomph.p2.internal.core;
1212

13-
import org.eclipse.oomph.p2.core.P2Util;
13+
import org.eclipse.oomph.p2.core.AgentManager;
1414
import org.eclipse.oomph.util.IOUtil;
1515
import org.eclipse.oomph.util.OomphPlugin;
1616
import org.eclipse.oomph.util.ReflectUtil;
@@ -174,7 +174,11 @@ protected Object getContainerAdapter(IContainer container, @SuppressWarnings("ra
174174
@Override
175175
public void stop(BundleContext context) throws Exception
176176
{
177-
((AgentManagerImpl)P2Util.getAgentManager()).dispose();
177+
AgentManager instance = AgentManagerImpl.instance;
178+
if (instance != null)
179+
{
180+
((AgentManagerImpl)instance).dispose();
181+
}
178182
super.stop(context);
179183
}
180184
}

0 commit comments

Comments
 (0)