[nautilus-python] python-object: Fix more memory leaks



commit 183a6cd3f54095c205442e1718e0f91d36ddc0c5
Author: Michael Webster <miketwebster gmail com>
Date:   Sat Jan 30 22:33:54 2021 -0500

    python-object: Fix more memory leaks
    
    Picked from https://github.com/linuxmint/nemo-extensions/commit/bd48a2da9012f81e0e3a1a09ca0069947a198de5
    
    The `CONVERT_LIST` part is already merged as 
https://gitlab.gnome.org/GNOME/nautilus-python/-/merge_requests/8
    
    The `Py_XDECREF(py_uri)` is not necessary since `N` arguments of `PyObject_CallMethod` do not increase 
reference count https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue
    It would cause a crash and was reverted in 
https://github.com/linuxmint/nemo-extensions/commit/74b9e778cfa71daa619e16b3c4f945d2725d24e2.

 src/nautilus-python-object.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/nautilus-python-object.c b/src/nautilus-python-object.c
index 167135e..001df00 100644
--- a/src/nautilus-python-object.c
+++ b/src/nautilus-python-object.c
@@ -149,6 +149,7 @@ nautilus_python_object_get_property_pages (NautilusPropertyPageProvider *provide
     HANDLE_LIST(py_ret, NautilusPropertyPage, "Nautilus.PropertyPage");
     
 beach:
+    free_pygobject_data_list (files);
     Py_XDECREF(py_ret);
     pyg_gil_state_release(state);
     return ret;


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