aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/indicator-power.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 6b95b4c..4eebf3a 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -50,6 +50,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define IS_INDICATOR_POWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_POWER_TYPE))
#define INDICATOR_POWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_POWER_TYPE, IndicatorPowerClass))
+GType indicator_power_get_type (void);
+
+INDICATOR_SET_VERSION
+INDICATOR_SET_TYPE (INDICATOR_POWER_TYPE)
+
typedef struct _IndicatorPower IndicatorPower;
typedef struct _IndicatorPowerClass IndicatorPowerClass;
typedef struct _IndicatorPowerPrivate IndicatorPowerPrivate;
@@ -66,8 +71,6 @@ struct _IndicatorPowerClass
IndicatorObjectClass parent_class;
};
-GType indicator_power_get_type (void) G_GNUC_CONST;
-
struct _IndicatorPowerPrivate
{
@@ -101,10 +104,6 @@ static const gchar* get_name_hint (IndicatorObject * io);
G_DEFINE_TYPE (IndicatorPower, indicator_power, INDICATOR_OBJECT_TYPE);
-/* Indicator stuff */
-INDICATOR_SET_VERSION
-INDICATOR_SET_TYPE (INDICATOR_POWER_TYPE)
-
static void
indicator_power_class_init (IndicatorPowerClass *klass)
@@ -901,6 +900,16 @@ indicator_power_dispose (GObject *object)
{
IndicatorPowerPrivate *priv = INDICATOR_POWER(object)->priv;
+ if (priv->devices != NULL) {
+ g_variant_unref (priv->devices);
+ priv->devices = NULL;
+ }
+
+ if (priv->device != NULL) {
+ g_variant_unref (priv->device);
+ priv->device = NULL;
+ }
+
g_clear_object (&priv->settings);
G_OBJECT_CLASS (indicator_power_parent_class)->dispose (object);