GNOME Bugzilla – Bug 760670
meta-launch: don't call g_object_unref on NULL
Last modified: 2017-09-01 09:20:40 UTC
Created attachment 319097 [details] [review] Don't unref NULL pointer g_object_unref was called unconditionally on pointer that may have been NULL in get_primary_gpu_path resulting in a bunch of CRITICAL messages
Review of attachment 319097 [details] [review]: lgtm
Review of attachment 319097 [details] [review]: ::: src/backends/native/meta-launcher.c @@ +342,3 @@ /* found the boot_vga device */ path = g_strdup (g_udev_device_get_device_file (dev)); + break; doesn't this break the pci_device is going to get leaked ?
Created attachment 319510 [details] [review] meta-launcher: Avoid leaking a GUdevDevice -- oops, thanks for catching that
Review of attachment 319510 [details] [review]: Could you use g_autoptr?
Created attachment 319516 [details] [review] meta-launcher: Use g_auto* macros This fixes a couple of minor memory leaks. -- I keep forgetting this is a thing now. I had to add the G_DEFINE_AUTOPTRs here though since both GUdev and gdbus-codegen don't have them yet. I guess we can remove them when those upstreams add them and break the build?
See bug 755797 for a gdbus-codegen patch
Review of attachment 319516 [details] [review]: OK.
Attachment 319516 [details] pushed as 3cdcd3e - meta-launcher: Use g_auto* macros
(In reply to Rui Matos from comment #5) > I had to add the G_DEFINE_AUTOPTRs here though since both GUdev and > gdbus-codegen don't have them yet. I guess we can remove them when > those upstreams add them and break the build? The time is now: https://git.gnome.org/browse/libgudev/commit/?id=272533131c6ed38479a88805c023d8375fb38adc Which means Mutter's build is now broken in Continuous.
(In reply to Rui Matos from comment #5) <snip> > I had to add the G_DEFINE_AUTOPTRs here though since both GUdev and > gdbus-codegen don't have them yet. I guess we can remove them when > those upstreams add them and break the build? libgudev was already a GNOME project at the time this was written: https://git.gnome.org/browse/libgudev So the upstream would have been us anyway. I'll release version 232 today, which you can depend on for that functionality.
(In reply to Bastien Nocera from comment #10) > I'll release version 232 today, which you can depend on for that > functionality. Released: https://download.gnome.org/sources/libgudev/232/
Created attachment 358904 [details] [review] build: Require libgudev >= 232 And remove the g_autoptr implementations in mutter itself.
Review of attachment 358904 [details] [review]: lgtm
Attachment 358904 [details] pushed as 361bf84 - build: Require libgudev >= 232