[gjs] gi: make it more clear only processed_in_args are being released



commit c37384dfb99d8ff7f0d91758786721c9cf114df8
Author: Tommi Komulainen <tko litl com>
Date:   Tue Mar 2 13:54:22 2010 +0000

    gi: make it more clear only processed_in_args are being released
    
    If the loop ends "prematurely" because of processed_in_args then the
    invoke had failed and INOUT/OUT arguments wouldn't be handled anyway so
    there's no point in continuing with the loop.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=611603

 gi/function.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gi/function.c b/gi/function.c
index fbca794..250f526 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -738,7 +738,7 @@ release:
     inout_args_pos = 0;
 
     postinvoke_release_failed = FALSE;
-    for (i = 0; i < n_args; i++) {
+    for (i = 0; i < n_args && in_args_pos < processed_in_args; i++) {
         GIDirection direction;
         GIArgInfo arg_info;
         GITypeInfo arg_type_info;
@@ -748,8 +748,7 @@ release:
 
         g_arg_info_load_type(&arg_info, &arg_type_info);
 
-        if ((direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) &&
-            (in_args_pos < processed_in_args)) {
+        if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) {
             GArgument *arg;
             GITransfer transfer;
 



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