From 85fa81c7c88da14ed285f96ed271fbe19e4d93b3 Mon Sep 17 00:00:00 2001 From: Fotis Xenakis Date: Sat, 18 May 2024 17:42:30 +0200 Subject: [PATCH] docs: basic-tutotial-1: Don't crash on error Using g_error() crashes the application, producing a coredump e.g. when the user closes the video window, which can be confusing (especially on the very first tutorial). Let's change this to log the error message without crashing, using g_printerr(), like subsequent tutorials. Part-of: --- subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c b/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c index ba4d5d77f9..edc08f0260 100644 --- a/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c +++ b/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c @@ -31,8 +31,8 @@ tutorial_main (int argc, char *argv[]) /* See next tutorial for proper error message handling/parsing */ if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) { - g_error ("An error occurred! Re-run with the GST_DEBUG=*:WARN environment " - "variable set for more details."); + g_printerr ("An error occurred! Re-run with the GST_DEBUG=*:WARN " + "environment variable set for more details.\n"); } /* Free resources */