fortheusers / hb-appstore

Homebrew App Store - GUI for downloading/managing homebrew apps
https://hb-app.store
GNU General Public License v3.0
1.05k stars 61 forks source link

Sometimes crashes on "Adjust Sort" button #27

Closed vgmoose closed 4 years ago

vgmoose commented 5 years ago

If you spam the "Adjust Sort" button (on any platform– PC, Switch, or Wii U) it will eventually crash.

It stops at the following line with a segfault: https://github.com/vgmoose/hb-appstore/blob/master/gui/Element.cpp#L20 (at x=0)

In the debugger, this->elements[x] is not NULL (so it makes sense that it makes it through the above if condition, and probably isn't a race condition), but it still appears to be erroring when trying to invoke process.

It's also worth noting that every time the "Adjust Sort" button is pressed, about 0.2 MB of memory leaks, so some other assumption when sorting is probably also bugged.

vgmoose commented 4 years ago

Fixed in 2.2 by rw!

The bug had to do with accessing unfreed memory, as the sort button is part of the elements that get re-added after sorting