mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 09:03:51 -05:00
removed multiple references to temporary passed accross threads, causing random crashes
This commit is contained in:
parent
2ab012261b
commit
0ff4426d72
4 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue