This is an automated email from the git hooks/post-receive script.

andre pushed a 
commit to branch 
master
in repository apps/xfce4-screenshooter.

commit 07dfa8e1b7a7c2ea02dc088ca1a68d7517712b45
Author: Evangelos Foutras <evange...@foutrelis.com>
Date:   Sun Jun 25 04:02:23 2017 +0300

    Implement alternate fix for crash on upload (#11879)
    
    The original fix complicated the code by individually allocating GValue
    objects and then storing pointers to them in the job parameters array.
    
    While the crash on upload was fixed, the program would still crash on
    exit due to the clear_func used for the array (g_free); as per GLib's
    documentation, "clear_func is expected to clear the contents of the
    array element it is given, but not free the element itself".
    
    The minimal fix in this commit should fix the original issue, and also
    the crash on program exit (bug #13684).
---
 lib/screenshooter-simple-job.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/screenshooter-simple-job.c b/lib/screenshooter-simple-job.c
index da06f4d..cb22f78 100644
--- a/lib/screenshooter-simple-job.c
+++ b/lib/screenshooter-simple-job.c
@@ -156,7 +156,6 @@ screenshooter_simple_job_launch (ScreenshooterSimpleJobFunc 
func,
 {
   ScreenshooterSimpleJob *simple_job;
   va_list var_args;
-  GValue value = { 0, };
   gchar *error_message;
   guint n;
 
@@ -164,11 +163,14 @@ screenshooter_simple_job_launch 
(ScreenshooterSimpleJobFunc func,
   simple_job = g_object_new (SCREENSHOOTER_TYPE_SIMPLE_JOB, NULL);
   simple_job->func = func;
   simple_job->param_values = g_array_sized_new (FALSE, FALSE, sizeof(GValue), 
n_param_values);
+  g_array_set_clear_func (simple_job->param_values, (GDestroyNotify) 
g_value_unset);
 
   /* collect the parameters */
   va_start (var_args, n_param_values);
   for (n = 0; n < n_param_values; ++n)
     {
+      GValue value = { 0 };
+
       /* initialize the value to hold the next parameter */
       g_value_init (&value, va_arg (var_args, GType));
 
@@ -183,7 +185,6 @@ screenshooter_simple_job_launch (ScreenshooterSimpleJobFunc 
func,
         }
 
       g_array_append_val(simple_job->param_values, value);
-      g_value_unset (&value);
     }
   va_end (var_args);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to