summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-08-04 02:43:59 -0400
committerlukefromdc <[email protected]>2017-08-13 14:37:24 -0400
commita90b7f0e96fbc3e1fdc00dd02d69e00a867836a2 (patch)
tree2c8783e44148f2d88399d5d58601ae10a646d8a1 /applets
parent177273085cda821163bcbfd67693ec0f19f94ff7 (diff)
downloadmate-panel-a90b7f0e96fbc3e1fdc00dd02d69e00a867836a2.tar.bz2
mate-panel-a90b7f0e96fbc3e1fdc00dd02d69e00a867836a2.tar.xz
Clock: fix removal warnings when in-process applet removed
Diffstat (limited to 'applets')
-rw-r--r--applets/clock/clock.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index c081e3c3..c765b7ef 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -501,6 +501,8 @@ get_updated_timeformat (ClockData *cd)
static void
update_timeformat (ClockData *cd)
{
+ if (cd->settings == NULL)
+ return;
if (cd->timeformat)
g_free (cd->timeformat);
cd->timeformat = get_updated_timeformat (cd);
@@ -701,6 +703,8 @@ update_tooltip (ClockData * cd)
static void
refresh_clock (ClockData *cd)
{
+ if (cd->settings == NULL)
+ return;
unfix_size (cd);
update_clock (cd);
}
@@ -708,6 +712,9 @@ refresh_clock (ClockData *cd)
static void
refresh_clock_timeout(ClockData *cd)
{
+ if (cd->settings == NULL)
+ return;
+
unfix_size (cd);
update_timeformat (cd);
@@ -763,12 +770,10 @@ destroy_clock (GtkWidget * widget, ClockData *cd)
if (cd->calendar_popup)
gtk_widget_destroy (cd->calendar_popup);
-/* FIXME this stops segfaults on removing the clock applet when it is*/
-/* built in-process but leaves part of it in RAM until the panel is restarted */
-#ifndef CLOCK_INPROCESS
cd->calendar_popup = NULL;
g_free (cd->timeformat);
+
g_free (cd->custom_format);
free_locations (cd);
@@ -793,7 +798,6 @@ destroy_clock (GtkWidget * widget, ClockData *cd)
}
g_free (cd);
-#endif
}
static gboolean
@@ -1994,6 +1998,9 @@ static void
update_weather_bool_value_and_toggle_from_gsettings (ClockData *cd, gchar *key,
gboolean *value_loc, const char *widget_name)
{
+ if (cd->settings == NULL)
+ return;
+
GtkWidget *widget;
gboolean value;
@@ -2073,6 +2080,9 @@ location_set_current_cb (ClockLocation *loc,
static void
locations_changed (ClockData *cd)
{
+ if (cd->settings == NULL)
+ return;
+
GList *l;
ClockLocation *loc;
glong id;
@@ -2276,6 +2286,9 @@ temperature_unit_changed (GSettings *settings,
gchar *key,
ClockData *cd)
{
+ if (cd->settings == NULL)
+ return;
+
cd->temperature_unit = g_settings_get_enum (settings, key);
if (cd->temperature_unit > 0)
{
@@ -2294,6 +2307,9 @@ speed_unit_changed (GSettings *settings,
gchar *key,
ClockData *cd)
{
+ if (cd->settings == NULL)
+ return;
+
cd->speed_unit = g_settings_get_enum (settings, key);
if (cd->speed_unit > 0)
{
@@ -2312,6 +2328,9 @@ custom_format_changed (GSettings *settings,
gchar *key,
ClockData *clock)
{
+ if (clock->settings == NULL)
+ return;
+
gchar *value;
value = g_settings_get_string (settings, key);