Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Applications.WidgetControl] Use Marshal.FreeHGlobal() instead of Lib… #5629

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Tizen.Applications.Cion/Interop/Interop.Cion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,5 @@ internal enum ErrorCode : int
TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut,
OperationFailed = -0x030C0000 | 0x01,
}

[DllImport(Libraries.Libc, EntryPoint = "malloc")]
internal static extern IntPtr Malloc(int size);
}
}
1 change: 0 additions & 1 deletion src/Tizen.Applications.Cion/Interop/Interop.Libraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ internal static partial class Interop
internal static partial class Libraries
{
public const string Cion = "libcion.so.1";
public const string Libc = "libc.so.6";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public ServerBase(string serviceName, string displayName, Cion.SecurityInfo secu
Marshal.Copy(data, receivedData, 0, dataSize);
byte[] returnDataRaw = OnDataReceived(receivedData, new PeerInfo(clone));
returnDataSize = returnDataRaw.Length;
returnData = Interop.Cion.Malloc(returnDataSize);
returnData = Marshal.AllocHGlobal(returnDataSize);
Marshal.Copy(returnDataRaw, 0, returnData, returnDataSize);
});
ret = Interop.CionServer.CionServerSetDataReceivedCb(_handle, _dataReceivedCb, IntPtr.Zero);
Expand Down
27 changes: 0 additions & 27 deletions src/Tizen.Applications.WidgetControl/Interop/Interop.Libc.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ internal static partial class Interop
internal static partial class Libraries
{
public const string WidgetService = "libwidget_service.so.1";
public const string Libc = "libc.so.6";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,11 @@ public IEnumerable<Scale> GetScales()
}
w = new int[cnt1];
Marshal.Copy(wPtr, w, 0, cnt1);
Interop.Libc.Free(wPtr);
Marshal.FreeHGlobal(wPtr);

h = new int[cnt1];
Marshal.Copy(hPtr, h, 0, cnt1);
Interop.Libc.Free(hPtr);
Marshal.FreeHGlobal(hPtr);

err = Interop.WidgetService.GetSupportedSizeTypes(Id, ref cnt2, out typesPtr);
switch (err)
Expand All @@ -734,7 +734,7 @@ public IEnumerable<Scale> GetScales()

types = new int[cnt2];
Marshal.Copy(typesPtr, types, 0, cnt2);
Interop.Libc.Free(typesPtr);
Marshal.FreeHGlobal(typesPtr);

for (int i = 0; i < cnt1; i++)
{
Expand Down
Loading