show confirmation dialog for dumping snapshot

This commit is contained in:
Alexey Kudravtsev
2009-09-10 20:11:32 +04:00
parent ff5b61f7f7
commit ac330cb627
@@ -231,10 +231,13 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
Disposer.dispose(this);
if (isInternal() && !Disposer.isEmpty()) {
try {
Class.forName("com.intellij.util.ProfilingUtil").getDeclaredMethod("forceCaptureMemorySnapshot").invoke(null);
}
catch (Exception ignored) {
int ret = Messages.showOkCancelDialog("Memory leaks detected. Create memory snapshot?", "Memory leaks", Messages.getErrorIcon());
if (ret == 0) {
try {
Class.forName("com.intellij.util.ProfilingUtil").getDeclaredMethod("forceCaptureMemorySnapshot").invoke(null);
}
catch (Exception ignored) {
}
}
}
Disposer.assertIsEmpty();