App crash when loading a lot of images
See original GitHub issueDescribe the bug
I’m calling github api and printing out the results, and for each result there is an avatar of the repo owner. After several calls and renders app crashes without any error. When I do not use <Image>
everything works fine.
To Reproduce It requires some setup, at least for my case, but maybe it is reproducible in some other way. Here are the basic steps:
-
Fetch results from github (i’m using axios and calling
https://api.github.com/search/repositories?q={term}&sort=stars&order=desc
), where{term}
is value from input. -
Print some repo details. Here’s jsx i’m using:
const list = items.map((item: any, index: number) => (
<View key={`github_${item.name}_${index}`} id="github-item">
<View id="github-image">
<Image src={item.avatar} id="#github-image-item" maxSize={{ width: 50, height: 50 }} />
</View>
<View id="github-content">
<Text>{item.owner}</Text>
<Text>{item.name}</Text>
<Text>{item.description}</Text>
</View>
</View>
))
return (
<View styleSheet={styleSheet}>{list}</View>
)
- Change input value several times, wait each time data to print
- Should crash after several times
If this is not enough for figuring it out, I can spend some time setting up a demo project, but i’m not sure how that will help since there is no any errors when it crashes.
Expected behavior Not to crash
Additional context
My assumption is that it has a memory leak somewhere, which should be either handled by QT, nodegui or a developer. I didn’t find anything that I should do to make it free up memory.
As noted above, when I remove <Image>
, text part properly works and do not crash.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Thanks for reporting back @kristijanhusak closing this issue for now.
I made it work with
useReducer
without any issues. I guess my code was causing some issues. Feel free to close this if you think there isn’t anything to fix.