xfangfang / borealis

Hardware accelerated, Nintendo Switch inspired UI library for PC, Android, iOS, PSV, PS4 and Nintendo Switch
Apache License 2.0
31 stars 21 forks source link

Fix: application might segfault at exit #55

Closed ThisALV closed 8 months ago

ThisALV commented 8 months ago

There is two bugs that sometimes caused a segfault when application exits :

xfangfang commented 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?

XITRIX commented 8 months ago

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

XITRIX commented 8 months ago

Looks like a really nice PR, could you please change this small things and will look perfect to me?

ThisALV commented 8 months ago

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 commented 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?

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

ThisALV commented 8 months ago

Looks like a really nice PR, could you please change this small things and will look perfect to me?

Commit done