Commit 890440a4 authored by Alexander Gramiak's avatar Alexander Gramiak

Simplify gdk_monitor_get_model string duplication

* src/xfns.c (x-display-monitor-attributes-list): Use dupstring over
explicit if/xstrdup.

* src/frame.c (free_monitors): Remove redundant check for NULL.
parent 29b36a00
Pipeline #1283 failed with stage
in 49 minutes and 39 seconds
...@@ -5670,8 +5670,7 @@ free_monitors (struct MonitorInfo *monitors, int n_monitors) ...@@ -5670,8 +5670,7 @@ free_monitors (struct MonitorInfo *monitors, int n_monitors)
{ {
int i; int i;
for (i = 0; i < n_monitors; ++i) for (i = 0; i < n_monitors; ++i)
if (monitors[i].name) xfree (monitors[i].name);
xfree (monitors[i].name);
xfree (monitors); xfree (monitors);
} }
# endif # endif
......
...@@ -5030,8 +5030,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) ...@@ -5030,8 +5030,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
mi->mm_height = height_mm; mi->mm_height = height_mm;
#if GTK_CHECK_VERSION (3, 22, 0) #if GTK_CHECK_VERSION (3, 22, 0)
if (gdk_monitor_get_model (monitor)) dupstring (&mi->name, (gdk_monitor_get_model (monitor)));
mi->name = xstrdup (gdk_monitor_get_model (monitor));
#elif GTK_CHECK_VERSION (2, 14, 0) #elif GTK_CHECK_VERSION (2, 14, 0)
mi->name = gdk_screen_get_monitor_plug_name (gscreen, i); mi->name = gdk_screen_get_monitor_plug_name (gscreen, i);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment