Skip to content
Snippets Groups Projects
Commit e6fb1df5 authored by Gaël Bonithon's avatar Gaël Bonithon
Browse files

power: Fix memory leak

(cherry picked from commit 00e3d12a)
parent 59115a13
No related branches found
No related tags found
No related merge requests found
......@@ -422,9 +422,12 @@ xfpm_power_sleep (XfpmPower *power, const gchar *sleep_time, gboolean force)
gtk_widget_destroy (dialog);
if ( !ret || ret == GTK_RESPONSE_NO)
{
g_object_unref (brightness);
return;
}
}
}
/* This is fun, here's the order of operations:
* - if the Logind is running then use it
......@@ -480,6 +483,7 @@ xfpm_power_sleep (XfpmPower *power, const gchar *sleep_time, gboolean force)
xfpm_power_get_properties (power);
/* Restore the brightness level from before we suspended */
xfpm_brightness_set_level (brightness, brightness_level);
g_object_unref (brightness);
#ifdef WITH_NETWORK_MANAGER
if ( network_manager_sleep )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment