[vlc-commits] macosx: move breakpad initialization and allow opt-out

Marvin Scholz git at videolan.org
Fri May 29 17:55:53 CEST 2020


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Mon May  4 20:40:23 2020 +0200| [dade737387c421b5bc9697728a1a6360bc1f7d6d] | committer: David Fuhrmann

macosx: move breakpad initialization and allow opt-out

Move the breakpad initialization right to the start of the program
and do not initialize breakpad if the VLC_DISABLE_BREAKPAD env variable
is set.

(cherry picked from commit 8aadaf3db18202ee4d05b84612ccd590f9774a07)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=dade737387c421b5bc9697728a1a6360bc1f7d6d
---

 bin/darwinvlc.m | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/darwinvlc.m b/bin/darwinvlc.m
index e3da5722a0..022c559b44 100644
--- a/bin/darwinvlc.m
+++ b/bin/darwinvlc.m
@@ -114,6 +114,13 @@ BreakpadRef initBreakpad()
  *****************************************************************************/
 int main(int i_argc, const char *ppsz_argv[])
 {
+#ifdef HAVE_BREAKPAD
+    BreakpadRef breakpad = NULL;
+
+    if (!getenv("VLC_DISABLE_BREAKPAD"))
+        breakpad = initBreakpad();
+#endif
+
     /* The so-called POSIX-compliant MacOS X reportedly processes SIGPIPE even
      * if it is blocked in all thread.
      * Note: this is NOT an excuse for not protecting against SIGPIPE. If
@@ -297,10 +304,6 @@ int main(int i_argc, const char *ppsz_argv[])
      * runloop is used. Otherwise, [NSApp run] needs to be called, which setups more stuff
      * before actually starting the loop.
      */
-#ifdef HAVE_BREAKPAD
-    BreakpadRef breakpad;
-    breakpad = initBreakpad();
-#endif
     @autoreleasepool {
         if(NSApp == nil) {
             CFRunLoopRun();
@@ -320,7 +323,8 @@ out:
     libvlc_release(vlc);
 
 #ifdef HAVE_BREAKPAD
-    BreakpadRelease(breakpad);
+    if (breakpad)
+        BreakpadRelease(breakpad);
 #endif
 
     return ret;



More information about the vlc-commits mailing list