Bug 556355 - Make sure the nsIMsgSend doesn't go away before we're done (take 2). r=me a=jorgk DONTBUILD
authorJorg K <jorgk@jorgk.com>
Fri, 13 Apr 2018 14:33:21 +0200
changeset 31370 4a08421a80cefbdfac98be07709687f69757c18e
parent 31369 5074b2ccb931aee4ba766f7cb724bc91a1b30fce
child 31371 1aa3902156b6792976feda9be3f8212953e07802
child 31373 6324de6a59c5eb3155902084341513013dce9ca0
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersme, jorgk
bugs556355
Bug 556355 - Make sure the nsIMsgSend doesn't go away before we're done (take 2). r=me a=jorgk DONTBUILD
mailnews/compose/src/nsMsgSend.cpp
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -4108,16 +4108,18 @@ nsMsgComposeAndSend::CreateAndSendMessag
               mozIDOMWindowProxy                *parentWindow,
               nsIMsgProgress                    *progress,
               nsIMsgSendListener                *aListener,
               const nsAString                   &password,
               const nsACString                  &aOriginalMsgURI,
               MSG_ComposeType                   aType
               )
 {
+  nsCOMPtr<nsIMsgSend> kungFuDeathGrip(this);
+
   nsresult      rv;
   /* First thing to do is to reset the send errors report */
   mSendReport->Reset();
   mSendReport->SetDeliveryMode(mode);
 
   mParentWindow = do_QueryInterface(parentWindow);
   mSendProgress = progress;
   mListener = aListener;