Keep strong ref after submit message
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 6 Sep 2018 13:03:13 +0000 (15:03 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Thu, 6 Sep 2018 13:03:13 +0000 (15:03 +0200)
* src/windowmessages.cpp (gpgol_window_proc): Keep strong
ref in send fallback.

--
The close cleans up the mail. If we release the strong ref
here it crashes sometimes.

GnuPG-Bug-Id: T4131

src/windowmessages.cpp

index e0c5bab..ff8a1db 100644 (file)
@@ -187,9 +187,12 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                  ERR_SEND_FALLBACK_FAILED);
                     }
                 }
+              else
+                {
+                  mail->releaseCurrentItem ();
+                }
               log_debug ("%s:%s:  Send for %p completed.",
                          SRCNAME, __func__, mail);
-              mail->releaseCurrentItem ();
               break;
             }
           case (BRING_TO_FRONT):