| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
We can move this into tp_dealloc now.
Only call unset() in the slice allocate case since g_boxed_free() will
do it anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This allows us to assume that the wrapper is always valid and remove
the _is_valid attribute.
One difference now is that g_boxed_free() is called when the wrapper can no longer
be used and that breaks the custom glib sources where g_boxed_free() triggers
the finalize callback which tries to call into a method of the wrapper.
To work around this provide a _clear_boxed() method which allows the wrapper
to free the underlying boxed in __del__ where the wrapper is still usable.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
After chaining up accessing anything on the instance will crash like
accessing self.g_type in this case. Guard against that by exposing if the
wrapped boxed is still there.
Ideally we shouldn't invalidate the object in __del__, but various
things depend on it atm. For another time..
|
| |
|
|
|
|
| |
does't support that.
TypeError is wrong there anyway.
|
| | |
|
| | |
|
| |
|
|
| |
No need to have two similarly named files
|
| |
|
|
|
|
|
| |
This asserts that PyType_Ready() was called on the types before using them
to create instances or as base class for other types.
With this PyPy no longer crashes when importing the _gi module.
|
| |
|
|
|
| |
They were all just ignoring errors.
Also change those functions to use the pygi prefix.
|
| |
|
|
| |
There is no pyglib anymore
|
| |
|
|
| |
This reverts commit 700c785367975995d24a8ffd00b2aa028ccf77e8.
|
| |
|
|
| |
This reverts commit a506d5e3c64321c43a4ce7c2a72ca8d36e985999.
|
| |
|
|
| |
This reverts commit daefdfa3e4dc97b4ae38250358d722f09764cc9b.
|
| |
|
|
| |
This reverts commit 9d96df1ea3ad533885fbcae4de693a3cd81e765a.
|
| |
|
|
|
|
| |
Making sure we don't attempt to g_boxed_copy a NULL pointer,
as this is explicitly disallowed, and setting slice-allocated
to FALSE once g_slice_free has been called.
|
| |
|
|
| |
This reverts commit 85175047e66dfc0c0263eac91d8056a95d0a60a0.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move all the random declarations in pygobject-private.h to their
respective header files. Rename pygobject.c to pygobject-object.c
so it's clearer that it's not the implementation of pygobject.h.
Add a new pygobject-internal.h which includes pygobject.h
with _INSIDE_PYGOBJECT_ defined like pygobject-private.h did.
In case you are looking at the git log and end up here due to the
rename try:
git log --follow pygobject-object.c
or on the web interface go to the history of the old file name:
https://git.gnome.org/browse/pygobject/log/gi/pygobject.c?id=6b702c052e9f26e809cff494f0c896d17a514c64
https://bugzilla.gnome.org/show_bug.cgi?id=767084
|
| |
|
|
|
|
| |
Instead include things where needed.
https://bugzilla.gnome.org/show_bug.cgi?id=767084
|
| |
|
|
|
|
|
|
|
|
|
| |
Replicate struct marshaling logic for determining if struct arguments
to signals should be passed by reference to callbacks.
Maintain a list of these structs and apply an in-place copy of the struct
pointer if the struct wrapper is held longer than the duration of the
Python callback. This allows for both mutation of struct arguments from
callbacks as well as memory safety incase a callbacks holds onto the struct.
https://bugzilla.gnome.org/show_bug.cgi?id=736175
|
| |
|
|
|
|
|
|
|
| |
Replace raising a TypeError in gi.types.Boxed() with a warning.
Even though passing arguments or keywords to the parent class is
incorrect here, raising an exception was causing a bit of fallout
in some apps (Gramps).
https://bugzilla.gnome.org/show_bug.cgi?id=727810
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change pygi_boxed_new() to accept "copy_boxed" instead of "free_on_dealloc".
This changes memory management so the PyGIBoxed wrapper owns the boxed
pointer given to it. Use __del__ instead of dealloc for freeing the boxed
memory. This is needed for edge cases where objects like GSource can
trigger the finalized callback during de-alloc, resulting in the PyObjects
references counts being manipulated and triggering a re-entrant de-alloc.
Add hack to keep Gtk.TreeIter.do_iter_next/previous implementations working
which rely on pass-by-reference.
See also: https://bugzilla.gnome.org/show_bug.cgi?id=734465
https://bugzilla.gnome.org/show_bug.cgi?id=722899
https://bugzilla.gnome.org/show_bug.cgi?id=726999
|
| |
|
|
|
| |
Arguments to Py_TYPE() do not need to be cast since the macro always casts
to a PyObject* internall.
|
| |
|
|
|
|
|
|
| |
Add pyg_boxed_get_ptr and pyg_boxed_set_ptr macros for getting and setting
the boxed pointer field. This is preliminary cleanup work for supporting
fundamental types.
https://bugzilla.gnome.org/show_bug.cgi?id=631901
|
| |
|
|
|
|
|
|
|
|
|
| |
This is a partial revert of
https://git.gnome.org/browse/pygobject/commit/?id=2f2069c9efcd8
which removed a type check in __new__. This adds it back
into __init__. Overrides which define __new__ now have to
filter out any arguments in __init__ and not the other way
around, which is a bit less surprising in the common case.
https://bugzilla.gnome.org/show_bug.cgi?id=727810
|
| |
|
|
|
| |
Update all references to the FSF physical address
to use the web address: http://www.gnu.org/licenses
|
| |
|
|
|
|
|
|
| |
Remove gi._gobject._gobject as a separately compiled static module and
move all the files into gi._gi.
Remove dead module initialization macros from "pyglib-python-compat.h"
https://bugzilla.gnome.org/show_bug.cgi?id=712197
|
| |
|
|
|
|
|
|
| |
Give a cleaner error message when an attempt is made to create a disguised
struct which also gives a hint to look at the pydoc. Add similar error to
disguised boxed/unions.
https://bugzilla.gnome.org/show_bug.cgi?id=647249
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Remove PyGObject initializer code attempting to set properties on
GObjects that have already been created. There were a number of
overridden __new__ and __init__ methods that stripped away
arguments before calling the base class to work around attempted
property sets and argument count errors (fixing the symptom not
the problem).
Use Gtk.ListStore/TreeStore.new with __new__ override instead
of __init__ with set_column_types.
https://bugzilla.gnome.org/show_bug.cgi?id=705810
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Remove half implemented GC tracking from PyGIBaseInfo as it was not
needed (the implemented was also missing usage of PyObject_GC_New/Track).
Ensure weakref list for PyGIBaseInfo is initialized to NULL and cleared
properly.
Remove invalid calls to PyObject_GC_UnTrack and PyObject_ClearWeakRefs
for both PyGIStruct and PyGIBoxed as these types were not being
advertised as GC aware with Py_TPFLAGS_HAVE_GC.
https://bugzilla.gnome.org/show_bug.cgi?id=677091
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new "allocated_slice" argument to _pygi_boxed_new() which specifies
whether its "boxed" pointer was allocated using a slice (by giving its size) or
malloc (by specifying 0), as _pygi_boxed_new cannot determine that itself any
more.
Use this in _pygi_marshal_to_py_interface_struct() for caller-allocated boxed
values, as _caller_alloc() uses _pygi_boxed_alloc() for those (i. e. slices),
which would otherwise leak.
Thanks to Mike Gorse <mgorse@suse.com> for the original patch!
https://bugzilla.gnome.org/show_bug.cgi?id=691501
|
| |
|
|
|
|
|
| |
Remove workaround for g_struct_info_get_size reporting incorrect size
for boxed GValues. Verified this now returns the correct size of 24.
https://bugzilla.gnome.org/show_bug.cgi?id=622711
|
| |
|
|
|
|
|
|
| |
Expose read access to PyGIBoxed.free_on_dealloc.
Add GObject.Value.__del__ override and call unset() to
correctly free reference counts.
https://bugzilla.gnome.org/show_bug.cgi?id=688137
|
| |
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=615872
|
| |
|
|
|
|
|
|
|
|
| |
* add the glib dir to the includes list in the build
* make sure we include the compat macros
* add GLIB_PyBytes_FromString to compat macros
* add GLIB_PyNumber_Long to compat macros
* use RichCompare instead of Compare
https://bugzilla.gnome.org/show_bug.cgi?id=615872
|
| |
|
|
|
|
|
|
|
| |
* gi/pygi-boxed.[hc]: Refactor out the allocation of boxed structs
* gi/pygi-invoke.c: Don't use g_malloc0 for boxed structs that
are (caller-allocates)
* tests/test_overrides.py: Split the TreeView tests
https://bugzilla.gnome.org/show_bug.cgi?id=625653
|
| |
|
|
|
|
| |
astyle -p -d -c -S -U -M60
This won't affect git blame nor git diff if the switch -w is used.
|
| |
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=603598
|
| | |
|
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=602735
|