• Simon Feltman's avatar
    Add cleanup_data argument used for Python to C marshaler cleanup · 7407367f
    Simon Feltman authored
    Add a new output argument to all from_py marshalers which is used for
    keeping track of marshaling data that later needs cleanup. Previously most
    marshalers would rely on the GIArgument->v_pointer as the means for data
    cleanup. However, this pointer would get clobbered in the case of
    bi-directional arguments (inout) and the memory lost.
    Use the new cleanup_data for storing temporarily wrapped C arrays so we
    don't need to re-calculate the length argument during cleanup.
    Additionally delay the from_py marshaling cleanup function until after
    _invoke_marshal_out_args is called. This gives inout arguments which don't
    modify the pointer sufficient time to exist until they marshaled back to
    Python (gi_marshalling_tests_gvalue_inout).
pygi-marshal-from-py.c 61.5 KB