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 30534 4a08421a80cefbdfac98be07709687f69757c18e
parent 30533 5074b2ccb931aee4ba766f7cb724bc91a1b30fce
child 30535 1aa3902156b6792976feda9be3f8212953e07802
child 30537 6324de6a59c5eb3155902084341513013dce9ca0
push id2170
push usermozilla@jorgk.com
push dateFri, 13 Apr 2018 12:38:16 +0000
treeherdercomm-beta@4a08421a80ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;