about summary refs log tree commit diff
path: root/libnm-glib/nm-device-wimax.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-glib/nm-device-wimax.c')
-rw-r--r--libnm-glib/nm-device-wimax.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libnm-glib/nm-device-wimax.c b/libnm-glib/nm-device-wimax.c
index 48a518d7..62e3f772 100644
--- a/libnm-glib/nm-device-wimax.c
+++ b/libnm-glib/nm-device-wimax.c
@@ -25,6 +25,8 @@
 #include <string.h>
 #include <netinet/ether.h>
 
+#include "nm-glib-compat.h"
+
 #include <nm-setting-connection.h>
 #include <nm-setting-wimax.h>
 
@@ -42,7 +44,6 @@ G_DEFINE_TYPE (NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE)
 void _nm_device_wimax_set_wireless_enabled (NMDeviceWimax *wimax, gboolean enabled);
 
 typedef struct {
-	gboolean disposed;
 	DBusGProxy *proxy;
 
 	char *hw_address;
@@ -444,6 +445,8 @@ get_property (GObject *object,
 {
 	NMDeviceWimax *self = NM_DEVICE_WIMAX (object);
 
+	_nm_object_ensure_inited (NM_OBJECT (object));
+
 	switch (prop_id) {
 	case PROP_HW_ADDRESS:
 		g_value_set_string (value, nm_device_wimax_get_hw_address (self));
@@ -591,18 +594,18 @@ dispose (GObject *object)
 {
 	NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (object);
 
-	if (priv->disposed) {
-		G_OBJECT_CLASS (nm_device_wimax_parent_class)->dispose (object);
-		return;
+	if (priv->hw_address) {
+		g_free (priv->hw_address);
+		priv->hw_address = NULL;
 	}
 
-	priv->disposed = TRUE;
-
-	g_free (priv->hw_address);
-	g_free (priv->bsid);
+	if (priv->bsid) {
+		g_free (priv->bsid);
+		priv->bsid = NULL;
+	}
 
 	clean_up_nsps (NM_DEVICE_WIMAX (object), FALSE);
-	g_object_unref (priv->proxy);
+	g_clear_object (&priv->proxy);
 
 	G_OBJECT_CLASS (nm_device_wimax_parent_class)->dispose (object);
 }