Welcome,
Guest
. Please
login
or
register
.
December 11, 2024, 11:43:47 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UIDrawCall leaks if destroyed
« previous
next »
Print
Pages: [
1
]
Author
Topic: UIDrawCall leaks if destroyed (Read 2548 times)
Konstantin
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 6
UIDrawCall leaks if destroyed
«
on:
January 29, 2014, 07:22:20 AM »
From
UIDrawCall
static
public
void
Destroy
(
UIDrawCall dc
)
{
if
(
dc
)
{
if
(
Application
.
isPlaying
)
{
if
(
mActiveList
.
Remove
(
dc
)
)
{
NGUITools
.
SetActive
(
dc
.
gameObject
,
false
)
;
mInactiveList
.
Add
(
dc
)
;
// Leak!
}
}
else
{
mActiveList
.
Remove
(
dc
)
;
NGUITools
.
DestroyImmediate
(
dc
.
gameObject
)
;
}
}
}
Note that
OnDestroy
does not remove the
UIDrawCall
from any list. The
UIDrawCall
is stuck in the static
mInactiveList
until
ReleaseAll
is called which happens after last
UIPanel
is disabled.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: UIDrawCall leaks if destroyed
«
Reply #1 on:
January 29, 2014, 08:49:23 AM »
That's not a leak. The inactive list is re-used when you re-enable another panel. NGUI doesn't re-create draw calls if it can reuse them.
Logged
Konstantin
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 6
Re: UIDrawCall leaks if destroyed
«
Reply #2 on:
January 29, 2014, 09:20:45 AM »
Can I force a UIPanel to be destroyed completely with all its draw calls? I am absolutely sure that my draw call will not be reused and I want my 3MB of memory back :-)
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: UIDrawCall leaks if destroyed
«
Reply #3 on:
January 29, 2014, 10:09:24 AM »
UIDrawCall.ReleaseInactive() -- however I'm not sure if it's in the current public version. It's there in the Pro version though.
Logged
Konstantin
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 6
Re: UIDrawCall leaks if destroyed
«
Reply #4 on:
February 03, 2014, 06:18:53 AM »
Updated to 3.4.8. Added following code...
UIDrawCall
.
ReleaseInactive
(
)
;
Resources
.
UnloadUnusedAssets
(
)
;
...and the texture is gone from memory! Excellent. Thank you for support.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UIDrawCall leaks if destroyed