1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibGUI: Fix GDirectoryModel lifetime bug.

Thumbnail generation callbacks were getting called after the class was already being destroyed causing a crash to occur.
This commit is contained in:
Brandon Scott 2019-10-01 20:49:10 -05:00 committed by Andreas Kling
parent 9da121f837
commit 17597f4681
2 changed files with 9 additions and 2 deletions

View file

@ -5,7 +5,8 @@
#include <LibGUI/GModel.h>
#include <sys/stat.h>
class GDirectoryModel final : public GModel {
class GDirectoryModel final : public GModel
, public Weakable<GDirectoryModel> {
public:
static NonnullRefPtr<GDirectoryModel> create() { return adopt(*new GDirectoryModel); }
virtual ~GDirectoryModel() override;