Skip to content
Snippets Groups Projects
Verified Commit 79ce6038 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

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.
parent ce2d4def
No related branches found
No related tags found
No related merge requests found
Pipeline #3672 failed
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment