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



commit e3189d5f2f1f295c3dc09f32e4ce4525e71265c0
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]