Bug 1254829 - Calling TerminateProcess for WindowsXP to bypass DLL detach handler, r=bsmedberg, a=ritu
authorPeter Chang <pchang@mozilla.com>
Wed, 06 Apr 2016 10:05:58 +0800
changeset 323908 0066805fc2693643158737389d120851b3601cbb
parent 323907 aa68d889de64381a0d3741656c584ed36755167b
child 323909 b11fafb3a4f37e0ad60a84db609ec1df8b7b81fb
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, ritu
bugs1254829
milestone47.0a2
Bug 1254829 - Calling TerminateProcess for WindowsXP to bypass DLL detach handler, r=bsmedberg, a=ritu MozReview-Commit-ID: 41fuZobVVyv
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2309,17 +2309,25 @@ ContentChild::ProcessingError(Result aCo
 #endif
   NS_RUNTIMEABORT("Content child abort due to IPC error");
 }
 
 void
 ContentChild::QuickExit()
 {
   NS_WARNING("content process _exit()ing");
+
+#ifdef XP_WIN
+  // In bug 1254829, the destructor got called when dll got detached on windows,
+  // switch to TerminateProcess to bypass dll detach handler during the process
+  // termination.
+  TerminateProcess(GetCurrentProcess(), 0);
+#else
   _exit(0);
+#endif
 }
 
 nsresult
 ContentChild::AddRemoteAlertObserver(const nsString& aData,
                                      nsIObserver* aObserver)
 {
   NS_ASSERTION(aObserver, "Adding a null observer?");
   mAlertObservers.AppendElement(new AlertObserver(aObserver, aData));