Skip to content

gmain: Fix g_main_context_prepare priority annotation

David Emett requested to merge zdave/glib:fix-prepare-annot into master

I haven't actually tested this as I couldn't figure out how to generate a new gir file. Manually editing the gir on my system (by adding direction="out" caller-allocates="1" optional="1" to the priority parameter) and regenerating the typelib does fix the issue I was seeing though: in Python, MainContext.prepare accepts priority as an argument rather than returning it.

One thing I'm not clear on is why without the gir fix the integer argument passed to MainContext.prepare in Python was just getting cast directly to a pointer, resulting in a segfault if you passed anything other than 0. That is surely never the right thing to do, however the parameter is annotated?

Merge request reports