-
Notifications
You must be signed in to change notification settings - Fork 258
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
[NUI] Fix memory leaks in Size2D & Rectangle. #6681
base: DevelNUI
Are you sure you want to change the base?
Conversation
@@ -55,7 +55,7 @@ public Rectangle PositionSize | |||
} | |||
get | |||
{ | |||
Rectangle ret = Rectangle.GetRectangleFromPtr(Interop.WindowData.GetPositionSize(SwigCPtr)); | |||
Rectangle ret = Rectangle.GetRectangleFromPtr(Interop.WindowData.GetPositionSize(SwigCPtr), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interop.WindowData..GetPositionSize is related to CSharp_Dali_WindowData_GetPositionSize at csharp-binder side:
SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_WindowData_GetPositionSize(void* nuiWindowData)
{
void* nuiResult;
Dali::WindowData* pWindowData;
Dali::Rect result;
pWindowData = (Dali::WindowData*)nuiWindowData;
if(!pWindowData)
{
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
return nullptr;
}
{
try
{
result = pWindowData->GetPositionSize();
}
CALL_CATCH_EXCEPTION(0);
}
nuiResult = new Dali::Rect((const Dali::Rect&)result);
return nuiResult;
}
The return value is allocated by new operator, it need be deleted.
@@ -90,7 +90,7 @@ public Size2D GetSize() | |||
{ | |||
global::System.IntPtr cPtr = Interop.Picture.GetSize(View.getCPtr(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interop.Picture.GetSize is related to CSharp_Dali_Picture_GetSize:
SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Picture_GetSize(char *pPicture) {
Dali::CanvasRenderer::Picture picture;
Dali::Vector2 result;
if (!pPicture) {
SWIG_CSharpSetPendingExceptionArgument(
SWIG_CSharpArgumentNullException,
"Attempt to dereference null Dali::CanvasRenderer::Picture", 0);
return nullptr;
}
picture = *(Dali::CanvasRenderer::Picture *)pPicture;
{
try {
result = picture.GetSize();
}
CALL_CATCH_EXCEPTION(0);
}
return new Dali::Vector2((const Dali::Vector2 &)result);
}
Description of Change
API Changes