Skip to content

Fix memory leak in Widget lifecycle management#7349

Closed
tscholb wants to merge 450 commits intoSamsung:DevelNUIfrom
tscholb:251126_devel_widget_memory
Closed

Fix memory leak in Widget lifecycle management#7349
tscholb wants to merge 450 commits intoSamsung:DevelNUIfrom
tscholb:251126_devel_widget_memory

Conversation

@tscholb
Copy link
Copy Markdown
Contributor

@tscholb tscholb commented Nov 26, 2025

Fix Widget instances not properly removed from widgetList and Window objects accumulating in Registry. Enhanced HashCode-based widget management and ensured consistent HandleRef cleanup in SwigDirector methods to prevent memory leaks during create/destroy cycles.

Description of Change

API Changes

  • ACR:

rabbitfor and others added 30 commits July 18, 2025 16:31
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
This PR will deprecate `KeyFrames.Add` API with AlphaFunction.

Their is no way to interpolate each keyframes by alpha function.
Instead, we can control it by `AnimateBetween`'s intepolate enum.

So the inputed alpha function didn't have any efforts. So need to remove it.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
* Define Extents.Zero and apply it
* avoid using PropertyValue when get/set Padding and Margin

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
Signed-off-by: jmm <j0064423.lee@samsung.com>
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
ManufacturerDataLength
ManufacturerData
Name
ServiceUuidList
ServiceCount

Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Since Extents.Zero is static variable, it should not be disposed.
Signed-off-by: jmm <j0064423.lee@samsung.com>
Since LayoutItem implements IDisposable but it does not inherit from
BaseHandle, so property Disposed is added to LayoutItem like BaseHandle.
FlexLayout requires MarkDirty if child layout's layout properties are
changed.
e.g. MarkDirty is required if child layout's Width/HeightSpecification
is changed.
Let we allow to generate images with pre-multiplied options.

Relative dali patch :
- https://review.tizen.org/gerrit/c/platform/core/uifw/dali-csharp-binder/+/328075

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
It will throw exception when PROFILE_TV defined, and try to call Show() Hide() for CustomView.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Signed-off-by: jykeon <jykeon@samsung.com>
* [Applications.Common] Add KeepAlive for preventing _resControlCallback GC

Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>

* Add KeepAlive for preventing gc

Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>

---------

Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
Co-authored-by: hjhun <36876573+hjhun@users.noreply.github.com>
Let we prepare to create view at preload time if native engine support it.

Relative dali patch

https://review.tizen.org/gerrit/c/platform/core/uifw/dali-csharp-binder/+/328221

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Let we move AsyncImageLoader to public, and write some comments for it.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
The callstack:
Process terminated. A callback was made on a garbage collected delegate of type 'Tizen.NUI!Tizen.NUI.BaseComponents.WebView+JavaScriptMessageHandler::Invoke'.
   at Tizen.NUI.NDalicPINVOKE.ApplicationMainLoop(System.Runtime.InteropServices.HandleRef)
   at Tizen.NUI.Application.MainLoop()
   at Tizen.NUI.NUICoreBackend.Run(System.String[])
   at Tizen.Applications.CoreApplication.Run(System.String[])
   at Tizen.NUI.NUIApplication.Run(System.String[])
   at Tizen.TV.FLUX.FluxApplication.Run(System.String[])
   at Tizen.TV.Service.CNCapsule.Program.Main(System.String[])
DotNET onSigabrt called on com.samsung.tv.cnvoice-assistant / DN_ce-assistant(20535)
onSigabrt called

The reason might be that a local variable is gc-ed, but it is still used in unmanaged code, according to
[1] and [2].

[1] https://stackoverflow.com/questions/6193711/call-has-been-made-on-garbage-collected-delegate-in-c
[2] https://learn.microsoft.com/en-us/dotnet/framework/debug-trace-profile/callbackoncollecteddelegate-mda
Window insets are the inner size between window content and window edge.

Window insets are required when system UI such as status bar, virtual
keyboard, or clipboard appears on window to avoid window content
obscured by them.

To provide the combined window insets for the specified parts of the
system UI, GetInsets is added to Window.

The parameter insetsFlags of GetInsets is a bitwise combination of
InsetsPartFlags values specifying which window insets parts to include.
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
To make ensure we can call Awake(), we should initialize this instance
at mainthread at least once.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
We should check it after `Interop.Application.PreInitialize()` called.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
jeik01 and others added 2 commits November 25, 2025 12:06
Fix Widget instances not properly removed from widgetList and Window objects accumulating in Registry.
Enhanced HashCode-based widget management and ensured consistent HandleRef cleanup in SwigDirector methods to prevent memory leaks during create/destroy cycles.
@JoonghyunCho
Copy link
Copy Markdown
Member

Please note that, API13 branch is now sync to VD FET, and main branch is upgraded to API14.

@hinohie
Copy link
Copy Markdown
Contributor

hinohie commented Dec 11, 2025

Please force-reset the DevelNUI branch first.

@tscholb tscholb closed this Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.