summaryrefslogtreecommitdiffstats
path: root/mono/DBusType
diff options
context:
space:
mode:
Diffstat (limited to 'mono/DBusType')
-rw-r--r--mono/DBusType/Array.cs2
-rw-r--r--mono/DBusType/ObjectPath.cs5
-rw-r--r--mono/DBusType/String.cs5
3 files changed, 9 insertions, 3 deletions
diff --git a/mono/DBusType/Array.cs b/mono/DBusType/Array.cs
index 7e46f73d..ef001b98 100644
--- a/mono/DBusType/Array.cs
+++ b/mono/DBusType/Array.cs
@@ -59,7 +59,7 @@ namespace DBus.DBusType
IntPtr arrayIter = Marshal.AllocCoTaskMem (Arguments.DBusMessageIterSize);
if (!dbus_message_iter_open_container (iter,
- (int) this.Code,
+ (int) Code,
Arguments.GetCodeAsString (elementType),
arrayIter)) {
throw new ApplicationException("Failed to append array argument: " + val);
diff --git a/mono/DBusType/ObjectPath.cs b/mono/DBusType/ObjectPath.cs
index 01a21ca9..4f064d59 100644
--- a/mono/DBusType/ObjectPath.cs
+++ b/mono/DBusType/ObjectPath.cs
@@ -52,7 +52,10 @@ namespace DBus.DBusType
{
IntPtr marshalVal = Marshal.StringToHGlobalAnsi (Path);
- if (!dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal))
+ bool success = dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal);
+ Marshal.FreeHGlobal (marshalVal);
+
+ if (!success)
throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
}
diff --git a/mono/DBusType/String.cs b/mono/DBusType/String.cs
index bf354ea0..3b619cfb 100644
--- a/mono/DBusType/String.cs
+++ b/mono/DBusType/String.cs
@@ -36,7 +36,10 @@ namespace DBus.DBusType
{
IntPtr marshalVal = Marshal.StringToHGlobalAnsi (val);
- if (!dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal))
+ bool success = dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal);
+ Marshal.FreeHGlobal (marshalVal);
+
+ if (!success)
throw new ApplicationException("Failed to append STRING argument:" + val);
}