Bug 63324	Plugin not deactivated with Exception at startup()
diff --git a/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/compatibility/PluginActivator.java b/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/compatibility/PluginActivator.java
index aeea375..93bc957 100644
--- a/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/compatibility/PluginActivator.java
+++ b/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/compatibility/PluginActivator.java
@@ -45,8 +45,15 @@
 		this.context = context;
 		PluginDescriptor pd = (PluginDescriptor) Platform.getPluginRegistry().getPluginDescriptor(context.getBundle().getSymbolicName());
 		plugin = pd.getPlugin();
-		plugin.start(context);
-		plugin.startup();
+		try {
+			plugin.start(context);
+			plugin.startup();
+		} catch(Exception e) {
+			plugin.shutdown();
+			plugin.stop(context);
+			pd.markAsDeactivated();
+			throw e;
+		}
 	}
 
 	private void ensureNormalStartup(BundleContext context) throws BundleException {
diff --git a/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/plugins/PluginDescriptor.java b/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/plugins/PluginDescriptor.java
index bab92a7..a771088 100644
--- a/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/plugins/PluginDescriptor.java
+++ b/bundles/org.eclipse.core.runtime.compatibility/src-runtime/org/eclipse/core/internal/plugins/PluginDescriptor.java
@@ -439,4 +439,8 @@
 	public boolean hasPluginObject() {
 		return pluginObject!=null;
 	}
+
+	public void markAsDeactivated() {
+		deactivated = true;
+	}
 }
\ No newline at end of file