This is a migrated thread and some comments may be shown as answers.

Memory leak?

3 Answers 47 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 01 Feb 2010, 03:01 PM
Hello,
In my application I add a usercontrol containing raddocking to the visual tree. When I remove this usercontrol from the visual tree it stays in memory because it seems that raddocking still has a reference to something. See example code below.


<UserControl xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"  x:Class="UserControl1" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
             mc:Ignorable="d"  
             d:DesignHeight="300" d:DesignWidth="300"
    <Grid> 
            <my:RadDocking></my:RadDocking> 
    </Grid> 
</UserControl>

 

<Window x:Class="MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="MainWindow" Height="350" Width="525"
    <Grid> 
        <DockPanel  Name="DockPanel1"
            <StackPanel Orientation="Horizontal" DockPanel.Dock="top" HorizontalAlignment="Center" VerticalAlignment="Top" > 
                <Button Name="Add" Click="Add_Click" Margin="5">Add</Button> 
                <Button Name="Remove" Click="Remove_Click" Margin="5" >remove</Button> 
           </StackPanel> 
        </DockPanel> 
    </Grid> 
</Window> 
 
Class MainWindow  
    Private uc As New UserControl1 
    Private Sub Add_Click(ByVal sender As System.ObjectByVal e As System.Windows.RoutedEventArgs) 
        If Not DockPanel1.Children.Contains(uc) Then 
            DockPanel1.Children.Add(uc) 
        End If 
    End Sub 
 
    Private Sub Remove_Click(ByVal sender As System.ObjectByVal e As System.Windows.RoutedEventArgs) 
        If DockPanel1.Children.Contains(uc) Then 
            DockPanel1.Children.Remove(uc) 
        End If 
        uc = Nothing 
    End Sub 
End Class 

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 03 Feb 2010, 12:04 PM
Hello Thomas,

 Thank you for reporting us this issue. We will log it and schedule fixing it for one of the upcoming releases. Your Telerik points were updated.

Sincerely yours,
Miroslav Nedyalkov
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Lior ef
Top achievements
Rank 1
answered on 21 Feb 2010, 03:02 PM
hi,

will this porb. be fixed in the upcoming release (Q1 2010)? 

thanks.
0
Miroslav Nedyalkov
Telerik team
answered on 23 Feb 2010, 12:46 PM
Hi Lior,

 We will do our best to fix it for Q1.

Kind 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.
Tags
Docking
Asked by
Thomas
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Lior ef
Top achievements
Rank 1
Share this question
or