diff --git a/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp index 684b85e54..57adbb39d 100644 --- a/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp +++ b/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp @@ -186,13 +186,13 @@ void BaseBoardsCommentsItem::loadMessage() if (posts.size() == 1) { std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl; - const RsPostedPost& post(posts[0]); + RsPostedPost post(posts[0]); // no reference to temporary because it's passed to a thread! RsQThreadUtils::postToObject( [post,this]() { setPost(post,true); mIsLoadingMessage = false;}, this ); } else if(comments.size() == 1) { - const RsGxsComment& cmt = comments[0]; + RsGxsComment cmt(comments[0]); std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl; RsQThreadUtils::postToObject( [cmt,this]() diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp index 296f3f173..ecbba96af 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp @@ -292,13 +292,13 @@ void ChannelsCommentsItem::loadMessage() #ifdef DEBUG_ITEM std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl; #endif - const RsGxsChannelPost& post(posts[0]); + RsGxsChannelPost post(posts[0]); // no reference to temporary here, because we pass this to a thread RsQThreadUtils::postToObject( [post,this]() { setPost(post); }, this ); } else if(comments.size() == 1) { - const RsGxsComment& cmt = comments[0]; + RsGxsComment cmt(comments[0]); #ifdef DEBUG_ITEM std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl; #endif diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp index 1d61bb98b..43c94a377 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp @@ -125,7 +125,7 @@ void GxsForumGroupItem::loadGroup() std::cerr << std::endl; return; } - const RsGxsForumGroup& group(groups[0]); + RsGxsForumGroup group(groups[0]);// no reference to teporary accross threads! RsQThreadUtils::postToObject( [group,this]() { diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index 556dd1108..eedb4ae20 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -235,7 +235,7 @@ void GxsForumMsgItem::loadMessage() std::cerr << std::endl; return; } - const RsGxsForumMsg& msg(msgs[0]); + RsGxsForumMsg msg(msgs[0]); RsQThreadUtils::postToObject( [msg,this]() { @@ -280,7 +280,7 @@ void GxsForumMsgItem::loadParentMessage(const RsGxsMessageId& parent_msg) std::cerr << std::endl; return; } - const RsGxsForumMsg& msg(msgs[0]); + RsGxsForumMsg msg(msgs[0]); RsQThreadUtils::postToObject( [msg,this]() {