Artifacts When Replacing ItemsSource
When IsViewReusingEnabled is enabled we're getting artifacts from previous views when replacing the bound ItemsSource
https://github.com/user-attachments/assets/d23dc77d-6783-4de2-a419-0579394954f5
Repro: https://github.com/reid-kirkpatrick/CarouselLeaks
Just remove IsViewReusingEnabled from the MainPage
Hey @reid-kirkpatrick, thanks for the report what platform does this bug affect? All or just a single one? (Windows, I guess?)
CC @DashTheDev
Hey @reid-kirkpatrick, thanks for the report what platform does this bug affect? All or just a single one? (Windows, I guess?)
CC @DashTheDev
Windows and iOS for sure. I can test Android tomorrow
I should get some time to look into this and #43 today or over the weekend.
Thanks for the repro project @reid-kirkpatrick 😄
I tried testing the repro project on Android, but can't even get the carousel to swipe for some reason 😬
Hey @AndreiMisiukevich,
I had a bit of a look at this when I had some free time, but I'm going to need to sit down for longer to fully understand what's going on in the ForceRedrawViews() and the processor so I'm not just changing things blindly (causing more issues). Which I don't think I'm going to have time for at the moment.
I can continue looking into after this week coming, or maybe some bits and pieces here and there during the week. But ultimately might be faster for you to look into this one if you get the chance. Otherwise all good I'll get to it when I can 😄
@reid-kirkpatrick, could you check the latest 1.1.1 version? (if not difficult) I fixed another bug but it might be the same root cause
@AndreiMisiukevich thanks for the quick turnaround! Unfortunately I didn't see any difference in behavior (at least on Windows) in 1.1.1
Well, you can try something hacky
Try to clear children completely before changing source like Children.Clear() and then Update source
Has you PR solved this issue too?
Has you PR solved this issue too?
Sorry for the delay on this! I'll try to test it and get back to you next week
@AndreiMisiukevich I can't tell that anything has changed here. It's not urgent for us now that the memory leak has been fixed though
I tried testing the repro project on Android, but can't even get the carousel to swipe for some reason 😬
Hey! FYI, I redownloaded this repro project to see why swipe wasn't working on Android. Once I added the following line in MauiProgram.cs it started working.