projects
/
platform
/
core
/
csapi
/
tizenfx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
415119a
)
[NUI] Fix some SVACE issues.
author
zhouhao02
<haozhou.zhou@samsung.com>
Fri, 1 Dec 2023 06:07:21 +0000
(14:07 +0800)
committer
Bowon Ryu
<wonrst22@naver.com>
Tue, 5 Dec 2023 07:45:45 +0000
(16:45 +0900)
src/Tizen.NUI.Physics2D/src/internal/chipmunk/NativeInterop.cs
patch
|
blob
|
history
src/Tizen.NUI.Physics2D/src/internal/chipmunk/cpSpaceDebugDrawOptions.cs
patch
|
blob
|
history
src/Tizen.NUI/src/public/BaseComponents/DirectRenderingGLView.cs
patch
|
blob
|
history
diff --git
a/src/Tizen.NUI.Physics2D/src/internal/chipmunk/NativeInterop.cs
b/src/Tizen.NUI.Physics2D/src/internal/chipmunk/NativeInterop.cs
index
a86f6bf
..
063968c
100644
(file)
--- a/
src/Tizen.NUI.Physics2D/src/internal/chipmunk/NativeInterop.cs
+++ b/
src/Tizen.NUI.Physics2D/src/internal/chipmunk/NativeInterop.cs
@@
-81,6
+81,9
@@
namespace Tizen.NUI.Physics2D.Chipmunk
public static IntPtr AllocStructure<T>()
{
int size = SizeOf<T>();
public static IntPtr AllocStructure<T>()
{
int size = SizeOf<T>();
+
+ Debug.Assert(size>0, "The memory size to be allocated should be greater than 0");
+
return Marshal.AllocHGlobal(size);
}
return Marshal.AllocHGlobal(size);
}
diff --git
a/src/Tizen.NUI.Physics2D/src/internal/chipmunk/cpSpaceDebugDrawOptions.cs
b/src/Tizen.NUI.Physics2D/src/internal/chipmunk/cpSpaceDebugDrawOptions.cs
index
7b9afef
..
6e3366f
100644
(file)
--- a/
src/Tizen.NUI.Physics2D/src/internal/chipmunk/cpSpaceDebugDrawOptions.cs
+++ b/
src/Tizen.NUI.Physics2D/src/internal/chipmunk/cpSpaceDebugDrawOptions.cs
@@
-104,10
+104,6
@@
namespace Tizen.NUI.Physics2D.Chipmunk
private IntPtr ToPointer()
{
IntPtr drawOptionsPtr = NativeInterop.AllocStructure<cpSpaceDebugDrawOptions>();
private IntPtr ToPointer()
{
IntPtr drawOptionsPtr = NativeInterop.AllocStructure<cpSpaceDebugDrawOptions>();
- if (Marshal.SizeOf(typeof(cpSpaceDebugDrawOptions)) == 0)
- {
- throw new ArgumentNullException("The size of type cpSpaceDebugDrawOptions should not be 0.");
- }
Marshal.StructureToPtr<cpSpaceDebugDrawOptions>(this, drawOptionsPtr, false);
Marshal.StructureToPtr<cpSpaceDebugDrawOptions>(this, drawOptionsPtr, false);
diff --git
a/src/Tizen.NUI/src/public/BaseComponents/DirectRenderingGLView.cs
b/src/Tizen.NUI/src/public/BaseComponents/DirectRenderingGLView.cs
index
2946cb4
..
63dbda6
100644
(file)
--- a/
src/Tizen.NUI/src/public/BaseComponents/DirectRenderingGLView.cs
+++ b/
src/Tizen.NUI/src/public/BaseComponents/DirectRenderingGLView.cs
@@
-186,18
+186,19
@@
namespace Tizen.NUI.BaseComponents
if (textures != null)
{
if (textures != null)
{
- int intptrBytes = checked(sizeof(IntPtr) * textures.Count);
+ int count = textures.Count;
+ int intptrBytes = checked(sizeof(IntPtr) * count);
if (intptrBytes>0)
{
IntPtr unmanagedPointer = Marshal.AllocHGlobal(intptrBytes);
if (intptrBytes>0)
{
IntPtr unmanagedPointer = Marshal.AllocHGlobal(intptrBytes);
- IntPtr[] texturesArray = new IntPtr[
textures.C
ount];
- for (int i = 0; i <
textures.C
ount; i++)
+ IntPtr[] texturesArray = new IntPtr[
c
ount];
+ for (int i = 0; i <
c
ount; i++)
{
texturesArray[i] = HandleRef.ToIntPtr(Texture.getCPtr(textures[i]));
}
{
texturesArray[i] = HandleRef.ToIntPtr(Texture.getCPtr(textures[i]));
}
-
System.Runtime.InteropServices.Marshal.Copy(texturesArray, 0, unmanagedPointer, textures.C
ount);
+
Marshal.Copy(texturesArray, 0, unmanagedPointer, c
ount);
- Interop.GLView.GlViewBindTextureResources(SwigCPtr, unmanagedPointer,
textures.C
ount);
+ Interop.GLView.GlViewBindTextureResources(SwigCPtr, unmanagedPointer,
c
ount);
Marshal.FreeHGlobal(unmanagedPointer);
}
}
Marshal.FreeHGlobal(unmanagedPointer);
}
}