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

How to release memory used by Image returned by converter in RadListView

4 Answers 123 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Gerry
Top achievements
Rank 1
Gerry asked on 08 Mar 2017, 09:35 PM

I have this list xaml:

        <StackLayout VerticalOptions="FillAndExpand">
          <telerikDataControls:RadListView x:Name="statesListView" ItemsSource="{Binding States}"
                                           IsItemSwipeEnabled="False"
                                           IsPullToRefreshEnabled="True"
                                           RefreshRequested="RefreshGesture"
                                           SelectionMode="Single"
                                           SwipeOffset="50,0,50,0"
                                           VerticalOptions="FillAndExpand"
                                           >

            <telerikDataControls:RadListView.ItemTemplate>
                <DataTemplate>
                    <telerikListView:ListViewTemplateCell>
                        <telerikListView:ListViewTemplateCell.View>
                                    
                            <StackLayout Margin="0" Padding="0" BackgroundColor="{Binding Path=., Converter={StaticResource stateConverter}, ConverterParameter='color'}">
                                <StackLayout Orientation="Horizontal" Padding="0" Spacing="0" Margin="0">
                                    <Image Source="{Binding Path=., Converter={StaticResource stateConverter}, ConverterParameter='image'}" HeightRequest="22" 
                                                    Aspect="AspectFit" Margin="3,3,3,0"/>
                                    <Label Text="{Binding Path=., Converter={StaticResource stateConverter}, ConverterParameter='time'}" VerticalOptions="Center" />
                                </StackLayout>
                                <Label Text="{Binding TransitionDescription}" HorizontalOptions="Start" VerticalOptions="Start" Margin="3,0,0,3"/>
                            </StackLayout>

                        </telerikListView:ListViewTemplateCell.View>
                    </telerikListView:ListViewTemplateCell>
                </DataTemplate>
            </telerikDataControls:RadListView.ItemTemplate>
          </telerikDataControls:RadListView>
        </StackLayout>

 

When the page goes out of scope, the Images will not released. This is related to the fact that they are returned by the converter - if I replace the image with a static image, like

<Image Source="refresh.png" Aspect="AspectFit"/>

Then there is no memory leak.

The problem, I cannot access the Image objects to null out the source of each. RadListView seems to have no way to traverse it's children.

This seems to be a bug in RadListView.

 

4 Answers, 1 is accepted

Sort by
0
Gerry
Top achievements
Rank 1
answered on 08 Mar 2017, 10:12 PM
I replaced RadListView with a ListView and the problem is fixed. Definitely a Telerik bug.
0
Rosy Topchiyska
Telerik team
answered on 13 Mar 2017, 03:35 PM
Hi Gerry,

Thank you for contacting us.

Indeed, the source of the control is not released and we will look into this issue. I have logged an item in our feedback portal where you can track the progress of the issue. I have also added Telerik points to your account as a token of gratitude for bringing this issue to our attention.

Regards,
Rosy Topchiyska
Telerik by Progress
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 Feedback Portal and vote to affect the priority of the items
0
steve
Top achievements
Rank 1
answered on 10 Nov 2017, 12:26 AM

Hi Rosy,

We really like the reordering as well as the two column feature of the RadListView. 

However, this bug with the image not being released for GC is causing my app to crash.  

Could you help move it further along the priority queue ?

Regards,

Steve

0
Stefan Nenchev
Telerik team
answered on 14 Nov 2017, 11:21 AM
Hello, Steve,

As advised in the feedback item comment, we are currently working on the item and expect to have a fix for the upcoming minor release(planned date is 24.11). Can you please test the behavior once the fix is available and update us in case the issue is still present.

Have a great week. 

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ListView
Asked by
Gerry
Top achievements
Rank 1
Answers by
Gerry
Top achievements
Rank 1
Rosy Topchiyska
Telerik team
steve
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or