1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 334687: Adapters could be created once a DsfSession is invalid

This commit is contained in:
Marc Khouzam 2011-01-18 18:57:44 +00:00
parent a5c5b5ff16
commit 96e5dddddb

View file

@ -352,6 +352,17 @@ public class GdbAdapterFactory
} }
adapterSet = fgLaunchAdapterSets.get(launch); adapterSet = fgLaunchAdapterSets.get(launch);
if (adapterSet == null) { if (adapterSet == null) {
// If the first time we attempt to create an adapterSet is once the session is
// already inactive, we should not create it and return null.
// This can happen, for example, when we run JUnit tests and we don't actually
// have a need for any adapters until the launch is actually being removed.
// Note that we must do this here because fgDisposedLaunchAdapterSets
// may not already know that the launch has been removed because of a race
// condition with the caller which is also processing a launchRemoved method.
// Bug 334687
if (session.isActive() == false) {
return null;
}
adapterSet = new SessionAdapterSet(launch); adapterSet = new SessionAdapterSet(launch);
fgLaunchAdapterSets.put(launch, adapterSet); fgLaunchAdapterSets.put(launch, adapterSet);
} }