[gtk+] Fixed gtk_distribute_natural_allocation() to place the g_newa *after* g_return_if_fail() guards.



commit c9ca4beb35ef51efc95abb1276e75e1da4534f9d
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Sep 22 13:57:35 2010 +0900

    Fixed gtk_distribute_natural_allocation() to place the g_newa *after* g_return_if_fail() guards.

 gtk/gtksizerequest.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 06a60f8..cf80491 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -690,11 +690,13 @@ gtk_distribute_natural_allocation (gint              extra_space,
 				   guint             n_requested_sizes,
 				   GtkRequestedSize *sizes)
 {
-  guint *spreading = g_newa (guint, n_requested_sizes);
+  guint *spreading;
   gint   i;
 
   g_return_val_if_fail (extra_space >= 0, 0);
 
+  spreading = g_newa (guint, n_requested_sizes);
+
   for (i = 0; i < n_requested_sizes; i++)
     spreading[i] = i;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]