Memory leak in Python DBus server application when using pygobject
I've been hunting down a memory leak in a DBus server application. There is a trivial example here: https://github.com/LEW21/pydbus/issues/83 that was reported by Mattias and I'm seeing exactly the same issue. I've attached a copy of the test client and server that he wrote.memtest.zip
I've run Mattias' DBus test server under valgrind and gdb, and it leaks a small amount of memory each time the code handles a request. I have inspected the leaked memory and the data looks like it is an object containing (amongst other things) a set of strings describing the call that is being made (it is the strings for the bus, path, method, session, etc.).
I've managed to isolate the difference in behaviour down to a change in Pygobject between version 3.24.1 and 3.25.1.
If I run the test application from Mattias, I don't get any data leaked with v3.24.1. If I run with v3.25.1 or later (I've tried up to and including 3.28.2), I get the memory leak.
I don't know if this is a bug introduced into Pygobject, or it is simply new behaviour and the higher level Python code must now explicitly free an object that was automatically freed before.