Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
593055be
Commit
593055be
authored
Feb 27, 2018
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(CoreManager): avoid in getChatModelFromSipAddress when migration chat room is used
parent
912b6761
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
CoreManager.cpp
src/components/core/CoreManager.cpp
+10
-7
CoreManager.hpp
src/components/core/CoreManager.hpp
+1
-1
No files found.
src/components/core/CoreManager.cpp
View file @
593055be
...
...
@@ -94,15 +94,18 @@ shared_ptr<ChatModel> CoreManager::getChatModelFromSipAddress (const QString &si
// Create a new chat model.
if
(
!
mChatModels
.
contains
(
sipAddress
))
{
Q_
ASSERT
(
mCore
->
createAddress
(
::
Utils
::
appStringToCoreString
(
sipAddress
))
!=
nullptr
);
Q_
CHECK_PTR
(
mCore
->
createAddress
(
::
Utils
::
appStringToCoreString
(
sipAddress
))
);
auto
deleter
=
[
this
](
ChatModel
*
chatModel
)
{
mChatModels
.
remove
(
chatModel
->
getSipAddress
());
delete
chatModel
;
};
// Don't use chatModel->getSipAddress() in lambda.
// If it is a migration chat room the chat room sip address can be changed!!!
auto
deleter
=
[
this
,
sipAddress
](
ChatModel
*
chatModel
)
{
bool
removed
=
mChatModels
.
remove
(
sipAddress
);
Q_ASSERT
(
removed
);
delete
chatModel
;
};
shared_ptr
<
ChatModel
>
chatModel
(
new
ChatModel
(
sipAddress
),
deleter
);
mChatModels
[
chatModel
->
getSipAddress
()
]
=
chatModel
;
mChatModels
[
sipAddress
]
=
chatModel
;
emit
chatModelCreated
(
chatModel
);
...
...
@@ -111,7 +114,7 @@ shared_ptr<ChatModel> CoreManager::getChatModelFromSipAddress (const QString &si
// Returns an existing chat model.
shared_ptr
<
ChatModel
>
chatModel
=
mChatModels
[
sipAddress
].
lock
();
Q_CHECK_PTR
(
chatModel
.
get
()
);
Q_CHECK_PTR
(
chatModel
);
return
chatModel
;
}
...
...
src/components/core/CoreManager.hpp
View file @
593055be
...
...
@@ -163,7 +163,7 @@ private:
SettingsModel
*
mSettingsModel
=
nullptr
;
AccountSettingsModel
*
mAccountSettingsModel
=
nullptr
;
QHash
<
QString
,
std
::
weak_ptr
<
ChatModel
>
>
mChatModels
;
QHash
<
QString
,
std
::
weak_ptr
<
ChatModel
>>
mChatModels
;
QTimer
*
mCbsTimer
=
nullptr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment