aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-03-29 00:20:40 +0200
committerdec05eba <dec05eba@protonmail.com>2021-03-29 00:20:40 +0200
commit3ac540c21116cb9cc91cfd1d7b0dd6f6ded31123 (patch)
treefdcd44bbfd3591279658f2f0ff5628033e0458d6 /src
parent016f115baf7fe8c080202e7969e5740a98cdc76e (diff)
Fix crash when editing text
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp2
-rw-r--r--src/QuickMedia.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 36c5b1b..7133fbe 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -77,7 +77,7 @@ namespace QuickMedia {
last_drawn_time = other.last_drawn_time;
embedded_item_status = other.embedded_item_status;
if(other.embedded_item) {
- embedded_item = std::make_shared<BodyItem>("");
+ embedded_item.reset(new BodyItem(""));
*embedded_item = *other.embedded_item;
} else {
embedded_item = nullptr;
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index e3f13de..b11befe 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3870,7 +3870,7 @@ namespace QuickMedia {
auto edit_body_item = message_to_body_item(current_room, message.get(), current_room->get_user_avatar_url(me), me->user_id);
edit_body_item->visible = false;
- load_cached_related_embedded_item(body_item.get(), message.get(), me, current_room, tabs[MESSAGES_TAB_INDEX].body->items);
+ load_cached_related_embedded_item(edit_body_item.get(), message.get(), me, current_room, tabs[MESSAGES_TAB_INDEX].body->items);
tabs[MESSAGES_TAB_INDEX].body->insert_items_by_timestamps({edit_body_item});
//unreferenced_events.push_back(message);