Permalink
Browse files

Fixes potential memory leak.

  • Loading branch information...
1 parent edae14c commit 443bc6a981802916e40da0e17fa530459aabceec @ZeroStride ZeroStride committed Nov 24, 2011
Showing with 7 additions and 1 deletion.
  1. +6 −0 csharp/AllJoynUnity/AllJoynUnity/MsgArg.cs
  2. +1 −1 csharp/AllJoynUnity/basic_client/Main.cs
View
6 csharp/AllJoynUnity/AllJoynUnity/MsgArg.cs
@@ -86,6 +86,12 @@ public void Set(object value)
string signature = "";
_setValue = value;
+ if(_bytePtr != IntPtr.Zero)
+ {
+ Marshal.FreeCoTaskMem(_bytePtr);
+ _bytePtr = IntPtr.Zero;
+ }
+
/*
ALLJOYN_ARRAY = 'a', ///< AllJoyn array container type
ALLJOYN_DICT_ENTRY = 'e', ///< AllJoyn dictionary or map container type - an array of key-value pairs
View
2 csharp/AllJoynUnity/basic_client/Main.cs
@@ -167,7 +167,7 @@ public static void Main(string[] args)
sMsgBus.Dispose();
sBusListener.Dispose();
- Console.WriteLine("basic client exiting with status {0} ({1})\n", status, status.ToString ());
+ Console.WriteLine("basic client exiting with status {0} ({1})\n", status, status.ToString());
}
}
}

0 comments on commit 443bc6a

Please sign in to comment.