[pygobject/pygobject-3-32] pygi-array: fix leak of transfer-full/container C arrays. Fixes #322



commit 7336790c8e8bc702555d87a5c7a4328af91bf744
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Fri Apr 19 18:48:20 2019 +0200

    pygi-array: fix leak of transfer-full/container C arrays. Fixes #322
    
    We did not free the array passed to us after marshalling, only the helper garray.
    
    Patch by Tomasz Mi─ůsko

 gi/pygi-array.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gi/pygi-array.c b/gi/pygi-array.c
index 073e1436..890e7c57 100644
--- a/gi/pygi-array.c
+++ b/gi/pygi-array.c
@@ -766,7 +766,7 @@ _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state,
             return;
 
         free_array = TRUE;
-        free_array_full = FALSE;
+        free_array_full = arg_cache->transfer != GI_TRANSFER_NOTHING;
     } else if (array_cache->array_type == GI_ARRAY_TYPE_PTR_ARRAY) {
         ptr_array_ = (GPtrArray *) data;
     } else {


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