fix 'library already disposed' error while update libraries from plugin

This commit is contained in:
Michael Nedzelsky
2014-12-11 16:52:30 +03:00
parent a49bcc8d39
commit 492a2a1dc8
@@ -83,7 +83,7 @@ public class OutdatedKotlinRuntimeNotification extends AbstractProjectComponent
return; return;
} }
final Collection<Library> outdatedLibraries = extractLibraries(versionedOutdatedLibraries); Collection<Library> outdatedLibraries = extractLibraries(versionedOutdatedLibraries);
String message; String message;
if (versionedOutdatedLibraries.size() == 1) { if (versionedOutdatedLibraries.size() == 1) {
@@ -124,6 +124,8 @@ public class OutdatedKotlinRuntimeNotification extends AbstractProjectComponent
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) { public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if ("update".equals(event.getDescription())) { if ("update".equals(event.getDescription())) {
Collection<VersionedLibrary> versionedOutdatedLibraries = findOutdatedKotlinLibraries(myProject, pluginVersion);
Collection<Library> outdatedLibraries = extractLibraries(versionedOutdatedLibraries);
KotlinRuntimeLibraryUtil.updateLibraries(myProject, outdatedLibraries); KotlinRuntimeLibraryUtil.updateLibraries(myProject, outdatedLibraries);
} }
else if ("ignore".equals(event.getDescription())) { else if ("ignore".equals(event.getDescription())) {