Closed ThisALV closed 8 months ago
@ThisALV Could you please provide a demo code about how to trigger this deletionPool bug?
@XITRIX do you have any thoughts on that?
It looks like a quite reasonable fix, but it’s almost 2am and I need to sleep. Tomorrow I’ll try to review it properly
Looks like a really nice PR, could you please change this small things and will look perfect to me?
Looks like a really nice PR, could you please change this small things and will look perfect to me?
Sure, I'm not near my computer rn but I'll push a commit in a few hours
@ThisALV Could you please provide a demo code about how to trigger this deletionPool bug?
@XITRIX do you have any thoughts on that?
To reproduce the bug :
In pokemon_view.cpp
line 55 was commented out, De-comment it, replace it by getAppletFrameItem()->setHintView(holder);
and set global quit to true in the main function, then inside the app, open a pokemon view in the pokedex and press + to quit the app while the pokemon view is displayed, it should segfault.
It seems closing the app while a hintview is displayed was triggering the segfault before the fix, explaining why it was commented out in the demo app
Looks like a really nice PR, could you please change this small things and will look perfect to me?
Commit done
There is two bugs that sometimes caused a segfault when application exits :
deletionPool
, when deleting a view, might inserts other views inside the deletionPool set by calling Box destructor, resulting in undefined behavior. To avoid this, the set is can be replaced by a queue. I added required checks inaddToFreeQueue
to avoid queuing the same view twice.hintView
is ptr locked before deletion. At application exit it sometimes caused hintView to be deleted twice causing a Segfault.