aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-power.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-02-01 18:55:19 -0600
committerCharles Kerr <charles.kerr@canonical.com>2012-02-01 18:55:19 -0600
commit85a04b44e3e4f77db07c52ab8667195c6c98cedf (patch)
tree6f68abdbf41fc1915c9b3fa2261d1609f4f7be39 /src/indicator-power.c
parent17626e17645023a17e843bedac589d6218ac38bf (diff)
downloadayatana-indicator-power-85a04b44e3e4f77db07c52ab8667195c6c98cedf.tar.gz
ayatana-indicator-power-85a04b44e3e4f77db07c52ab8667195c6c98cedf.tar.bz2
ayatana-indicator-power-85a04b44e3e4f77db07c52ab8667195c6c98cedf.zip
unref+clear Priv's variant fields in _dispose()
Diffstat (limited to 'src/indicator-power.c')
-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);