GNOME Bugzilla – Bug 772255
gresolver: Mark GResolver as an abstract class
Last modified: 2016-10-04 15:04:27 UTC
Trivial patch to mark GResolver as abstract. This breaks API, but arguably nobody could have been using the API in the way this breaks, so there should be no impact. I would be happy for the patch to be rejected for breaking API though. The motivation is to prevent people accidentally shooting themselves in the foot by using (e.g., in Python); resolver = Gio.Resolver() rather than resolver = Gio.Resolver.get_default() It’s a lot harder to get this wrong in C, since g_resolver_new() doesn’t exist. You’d have to do: resolver = g_object_new (G_TYPE_RESOLVER, NULL); rather than resolver = g_resolver_get_default ();
Created attachment 336670 [details] [review] gresolver: Mark GResolver as an abstract class It only works through its virtual methods, so while it could be instantiated before (and this is technically an API break), any instance of it would previously have crashed as soon as any of its methods were called anyway.
I think this is an acceptable ABI change, given the way GResolver is meant to be used.
Dan, what do you think (since you wrote GResolver)?
Sure
Thanks for the fast replies. Merged. Attachment 336670 [details] pushed as 10bac98 - gresolver: Mark GResolver as an abstract class