When calling foreach in the dictionary, g_object_ref() is called once on self, but in the callback it is assigned to a g_autoptr in each call. If there is only one entry in the dictionary, it works, but if there are several, the second time the callback is called, self will be freed again, and the program crashes.
When calling foreach in the dictionary, g_object_ref() is called once on self, but in the callback it is assigned to a g_autoptr in each call. If there is only one entry in the dictionary, it works, but if there are several, the second time the callback is called, self will be freed again, and the program crashes.