RadDocumentPane Closed? or Hidden?

7 posts, 0 answers
  1. ebaker
    ebaker avatar
    4 posts
    Member since:
    Jan 2010

    Posted 18 Feb 2010 Link to this post

    I'm using a RadDocking.PaneStateChange event handler to receive notification when one of the RadDocumentPanes is hidden. The RadDocumentPanes are created in code with the CanUserClose option set to True.

    When the user clicks the cross control to close the pane, the PaneStateChange event handler is fired and the pane's IsHidden field is set to True. But... if there are no other references in my code to this RadDocumentPane object that has been hidden, or to any of its content, are the pane object and its content released and Garbage Collected? Or are they orphaned and just eating up memory? I guess the difference between "hiding" and pane and "closing" it are not clear to me.

    I'm concerned about memory usage as I have several panes that can be opened, closed, and re-opened.

    Thanks,
    Eric Baker

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 19 Feb 2010 Link to this post

    Hello Eric,

     First of all I would advise you to use the Close event of the Docking control to determine when a pane is closed instead of the PaneStateChange event.

    When I pane is hidden it is not cleaned, but just hidden. If you need to clear the memory it uses you need to remove it from the Docking control and if you don't have other references the GC will do its job and clear it. The easies way to remove a pane from the Docking control is to use its RemoveFromParent method. For example you could handle the Close event and every time a pane is closed you could remove it to make sure it will clean the memory it occupies. 

    Of course there is a trade off - if you use the Save/load layout feature the content of the closed panes will not appear if you load a previously saved layout where these panes are not closed. This happens, because the content is removed from memory and the Docking control cannot load it.

    Hope this information is helpful.

    Best wishes,
    Miroslav Nedyalkov
    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. DevCraft banner
  4. ebaker
    ebaker avatar
    4 posts
    Member since:
    Jan 2010

    Posted 19 Feb 2010 Link to this post

    Thank you, Miroslav. I completely missed the Close event of the RadDocking control. That was exactly what I needed.

    Eric Baker

  5. James
    James avatar
    136 posts
    Member since:
    Nov 2008

    Posted 17 May 2010 Link to this post

    Hello,

    I am attaching to the Close event and calling RemoveFromParent, but the DocumentPane is still referenced, according to WinDBG:

            private static void OnDockingShellPaneClosed(object sender, StateChangeEventArgs e) {  
                foreach (var pane in e.Panes) {  
                    pane.RemoveFromParent();  
                }  
                GC.Collect();  
            } 

    After calling !gcroot <Address> this is the output :

    DOMAIN(05FA4AE8):HANDLE(Pinned):37012f4:Root:  081f6260(System.Object[])->
      07240808(SLTrader.App.Shell)->
      0728e8c0(Telerik.Windows.Controls.RadDocking)->
      072c861c(Telerik.Windows.Controls.Docking.DocumentHost)->
      073bb6d8(Telerik.Windows.Controls.RadSplitContainer)->
      073ee3b0(Telerik.Windows.Controls.ProportionalStackPanel)->
      073ee768(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      073ee7b4(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      073bb98c(Telerik.Windows.Controls.RadPaneGroup)->
      073bba6c(Telerik.Windows.Controls.SelectionChanger`1[[System.Object, mscorlib]])->
      078c3f0c(System.Collections.Generic.List`1[[System.Object, mscorlib]])->
      078c3f24(System.Object[])->
      073bc09c(Telerik.Windows.Controls.RadDocumentPane)
    DOMAIN(05FA4AE8):HANDLE(Pinned):37012f8:Root:  081f4260(System.Object[])->
      073bb98c(Telerik.Windows.Controls.RadPaneGroup)->
      073bba6c(Telerik.Windows.Controls.SelectionChanger`1[[System.Object, mscorlib]])->
      078c3f0c(System.Collections.Generic.List`1[[System.Object, mscorlib]])->
      078c3f24(System.Object[])->
      073bc09c(Telerik.Windows.Controls.RadDocumentPane)


    Can you replicate?

    I am using build Silverlight_4_2010_1_0515.

    Regards,

    James.
  6. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 19 May 2010 Link to this post

    Hello James,

     Thank you for reporting us this problem. I logged it in PITS and we will investigate what causes this problem. The PITS item id is 2207.

    Regards,
    Miroslav Nedyalkov
    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.
  7. James
    James avatar
    136 posts
    Member since:
    Nov 2008

    Posted 23 May 2010 Link to this post

    Thanks,

    Could you please post the PITS link again? I think the one you provided was an internal URL.

    James.
  8. Hristo
    Admin
    Hristo avatar
    408 posts

    Posted 27 May 2010 Link to this post

    Hello James,

    This pits issue is not public and is visible only under your account after login under Your Tracked Issues section.

    Sincerely yours,
    Hristo
    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
DevCraft banner