mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Fix crash when deleting room summary
Since this is used across different threads, we have to delete it on the event loop. Thank you, q234rty, for the help with debugging this.
This commit is contained in:
parent
ce2d4defde
commit
79ce60382a
2 changed files with 11 additions and 10 deletions
|
@ -25,6 +25,15 @@ class CombinedImagePackModel;
|
|||
class QMimeData;
|
||||
class QDropEvent;
|
||||
|
||||
struct DeleteLaterDeleter
|
||||
{
|
||||
void operator()(QObject *p)
|
||||
{
|
||||
if (p)
|
||||
p->deleteLater();
|
||||
}
|
||||
};
|
||||
|
||||
enum class MarkdownOverride
|
||||
{
|
||||
NOT_SPECIFIED, // no override set
|
||||
|
@ -278,14 +287,6 @@ private:
|
|||
bool uploading_ = false;
|
||||
bool containsAtRoom_ = false;
|
||||
|
||||
struct DeleteLaterDeleter
|
||||
{
|
||||
void operator()(QObject *p)
|
||||
{
|
||||
if (p)
|
||||
p->deleteLater();
|
||||
}
|
||||
};
|
||||
using UploadHandle = std::unique_ptr<MediaUpload, DeleteLaterDeleter>;
|
||||
std::vector<UploadHandle> unconfirmedUploads;
|
||||
std::vector<UploadHandle> runningUploads;
|
||||
|
|
|
@ -493,8 +493,8 @@ private:
|
|||
std::string last_event_id;
|
||||
std::string fullyReadEventId_;
|
||||
|
||||
std::unique_ptr<RoomSummary> parentSummary = nullptr;
|
||||
bool parentChecked = false;
|
||||
std::unique_ptr<RoomSummary, DeleteLaterDeleter> parentSummary = nullptr;
|
||||
bool parentChecked = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
|
|
Loading…
Reference in a new issue