From 2e2711d88eb2d7d962d14cf58acc5b2d06448c0f Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 9 Sep 2009 19:46:51 +0400 Subject: [PATCH] leak of project incorrectly instantiated in EarPackagingConversionTest --- .../history/integration/LocalHistoryComponent.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryComponent.java b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryComponent.java index c33fb4d7780a..50ea7154d42e 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryComponent.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryComponent.java @@ -13,10 +13,12 @@ import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ex.ProjectRootManagerEx; import com.intellij.openapi.startup.StartupManager; +import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.ShutDownTracker; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; +import com.intellij.openapi.Disposable; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.TestOnly; @@ -72,6 +74,11 @@ public class LocalHistoryComponent extends LocalHistory implements ProjectCompon } }; ShutDownTracker.getInstance().registerShutdownTask(myShutdownTask); + Disposer.register(myProject, new Disposable() { + public void dispose() { + disposeComponent(); + } + }); myStartupManager.registerPreStartupActivity(new Runnable() { public void run() {