RadBusyIndicator leaks if never visible

4 posts, 0 answers
  1. StackOverflowed
    StackOverflowed avatar
    32 posts
    Member since:
    Sep 2010

    Posted 02 May 2011 Link to this post

    In short, if a control template uses triggers with enter/leave actions affecting a UIElement which is collapsed, WPF will leak that UIElement (complete specifics can be found here: http://blog.ramondeklein.nl/index.php/2009/02/20/memory-leak-with-wpf-animations/). Briefly, what happens is that if the item is collapsed, the enter/exit actions will not actually occur, but will be placed in a "DeferredActions" table in the template itself. If the UIElement is never shown, then these deferred actions won't be evaluated, and they'll remain as strong references to the the still collapsed UIElement.

    In our case, this happens with the template for the RadBusyIndicator, which amongst other things, sets a ControlTemplate for the RadProgressBar it contains. The "IndeterminateDonut" UIElement in the RadProgressBar is initially Collapsed, even though there are Enter/Exit actions for animating it to continually go in a circle. Now this doesn't seem to be a problem when the BusyIndicator actually shows up at some point. However, when the RadBusyIndicator doesn't show up at any point during a Window's lifetime, and then the window is closed, we manifest the same exact problem as described above.

    The fix was to grab the default ControlTemplate for the RadBusyIndicator, and change the initial visibility of the RadProgressBar to Hidden instead of Collapsed, so those actions can be evaluated. I haven't tested if this affects animation performance, however. As the link describes, this is fixed in WPF 4 using the ConditionalWeakTable to keep weak references to the elements which deferred actions will affect.
  2. Pana
    Admin
    Pana avatar
    748 posts

    Posted 06 May 2011 Link to this post

    Hello,

    Thank you for the detailed explanation. We will try to workaround the issue. Probably we will make the busy donut Opacity="0" by default and set the Collapsed value on loaded or something like that so the triggers may be generated.

    All the best,
    Pana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. StackOverflowed
    StackOverflowed avatar
    32 posts
    Member since:
    Sep 2010

    Posted 06 May 2011 Link to this post

    As I said in my previous post, I've set it to Hidden and haven't seen any issues so far. FYI
  5. Pana
    Admin
    Pana avatar
    748 posts

    Posted 11 May 2011 Link to this post

    Hello StackOverflowed,

    The Content property of the preload bar can be customized so if a long text is put there it may stretch the content even if the loader is hidden. I do not think that such problems would occure but we will have to put some tests. We will still fix the memory leak.

    Regards,
    Pana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top