-
Notifications
You must be signed in to change notification settings - Fork 256
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] Search upper parents until registered object is found #5377
Conversation
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.
LGTM
BaseHandle baseHandle = Registry.GetManagedBaseHandleFromNativePtr(parent.Handle); | ||
InternalParent = baseHandle; | ||
|
||
return baseHandle as Container; |
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.
We may need to call DeleteBaseHandle
for cPtrParent
before return it. See how Tizen.NUI.Extensions.GetInstanceSafety<>
implemented.
return baseHandle as Container; | |
Interop.BaseHandle.DeleteBaseHandle(parent); | |
parenr = new HandelRef(null, IntPtr.Zero); | |
return baseHandle as Container; |
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.
Thanks for your comment. I think we forgot to Delete(parent). But I wonder how the last line(:280) matters. Why would you put another new (zero pointer handle) to this local variable (parent)?
I tried to search Tizen.NUI.Extensions.GetInstanceSafety<> function but could not find it.
Co-authored-by: Eunki Hong <[email protected]>
@jmmhappy
확인 부탁드립니다. 감사합니다. |
If a component's parent is not registered on NUI but still exists on DALi side, GetParent() on the object returns null.
This makes it impossible to reach to the component's NUI parent.
For example, when a child is Scene3D.Camera and its parent is SceneView, child.GetParent() always returns null(SceneView.mRootLayer not registered on NUI), thus SceneView is unreachable from Scene3D.Camera.
This patch implements recursive search on dali parents when NUI child's InternalParent is null.