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

5 posts, 0 answers
  1. Gerry
    Gerry avatar
    25 posts
    Member since:
    Jan 2017

    Posted 08 Mar Link to this post

    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.

     

  2. Gerry
    Gerry avatar
    25 posts
    Member since:
    Jan 2017

    Posted 08 Mar in reply to Gerry Link to this post

    I replaced RadListView with a ListView and the problem is fixed. Definitely a Telerik bug.
  3. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    586 posts

    Posted 13 Mar Link to this post

    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
  4. steve
    steve avatar
    4 posts
    Member since:
    May 2011

    Posted 09 Nov in reply to Rosy Topchiyska Link to this post

    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

  5. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    556 posts

    Posted 14 Nov Link to this post

    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
Back to Top