mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
meta-launcher: don't call g_object_unref() on NULL
g_object_unref() was called no matter what we got for value https://bugzilla.gnome.org/show_bug.cgi?id=760670
This commit is contained in:
parent
bcdda506e1
commit
e7a88dc6b2
@ -295,7 +295,7 @@ get_primary_gpu_path (const gchar *seat_name)
|
||||
if (!devices)
|
||||
goto out;
|
||||
|
||||
for (tmp = devices; tmp != NULL && path == NULL; tmp = tmp->next)
|
||||
for (tmp = devices; tmp != NULL; tmp = tmp->next)
|
||||
{
|
||||
GUdevDevice *platform_device = NULL, *pci_device = NULL;
|
||||
GUdevDevice *dev = tmp->data;
|
||||
@ -325,13 +325,15 @@ get_primary_gpu_path (const gchar *seat_name)
|
||||
continue;
|
||||
|
||||
platform_device = g_udev_device_get_parent_with_subsystem (dev, "platform", NULL);
|
||||
pci_device = g_udev_device_get_parent_with_subsystem (dev, "pci", NULL);
|
||||
|
||||
if (platform_device != NULL)
|
||||
{
|
||||
path = g_strdup (g_udev_device_get_device_file (dev));
|
||||
g_object_unref (platform_device);
|
||||
break;
|
||||
}
|
||||
else if (pci_device != NULL)
|
||||
|
||||
pci_device = g_udev_device_get_parent_with_subsystem (dev, "pci", NULL);
|
||||
if (pci_device != NULL)
|
||||
{
|
||||
/* get value of boot_vga attribute or 0 if the device has no boot_vga */
|
||||
boot_vga = g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga");
|
||||
@ -339,12 +341,12 @@ get_primary_gpu_path (const gchar *seat_name)
|
||||
{
|
||||
/* found the boot_vga device */
|
||||
path = g_strdup (g_udev_device_get_device_file (dev));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
g_object_unref (platform_device);
|
||||
g_object_unref (pci_device);
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free_full (devices, g_object_unref);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user