aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2012-09-11 19:38:46 -0700
committerRaphael Moll <ralf@android.com>2012-09-11 21:33:52 -0700
commit3430f2813e3eab87786079de2f82e566d07c056e (patch)
tree9cb055b26ee078d51efac48f72023ddc9279e6df /eclipse
parent82256a9db0e605d01d5d31477e4f20185ab66c78 (diff)
downloadsdk-3430f2813e3eab87786079de2f82e566d07c056e.zip
sdk-3430f2813e3eab87786079de2f82e566d07c056e.tar.gz
sdk-3430f2813e3eab87786079de2f82e566d07c056e.tar.bz2
Properly dispose DeviceManager from AvdManager.
Similar issue fixed by patch d1daeae66a0ebdf53076038dc4a1fe099c4141fb but this time for the AvdManager. Change-Id: I10af39d364e427d593078f8bfa23bba3ba7e1558
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java
index 855a7fa..e01bfab 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java
@@ -149,9 +149,17 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab {
public void createControl(Composite parent) {
Font font = parent.getFont();
- // reload the AVDs to make sure we are up to date
+ // Reload the AVDs to make sure we are up to date
try {
- Sdk.getCurrent().getAvdManager().reloadAvds(NullLogger.getLogger());
+ // SDK can be null if the user opens the dialog before ADT finished
+ // initializing the SDK itself. In this case just don't reload anything
+ // so there's nothing obsolete yet.
+ Sdk sdk = Sdk.getCurrent();
+ if (sdk != null) {
+ AvdManager avdMan = sdk.getAvdManager();
+ assert avdMan != null;
+ avdMan.reloadAvds(NullLogger.getLogger());
+ }
} catch (AndroidLocationException e1) {
// this happens if the AVD Manager failed to find the folder in which the AVDs are
// stored. There isn't much we can do at this point.