Commit 7c92738c authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/components/call/CallModel): do not set data model twice

parent a19d292b
......@@ -108,6 +108,10 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphoneCall) {
);
}
CallModel::~CallModel () {
mLinphoneCall->unsetData("call-model");
}
// -----------------------------------------------------------------------------
void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) {
......
......@@ -65,7 +65,7 @@ public:
Q_ENUM(CallStatus);
CallModel (std::shared_ptr<linphone::Call> linphoneCall);
~CallModel () = default;
~CallModel ();
std::shared_ptr<linphone::Call> getLinphoneCall () const {
return mLinphoneCall;
......
......@@ -179,7 +179,6 @@ void CallsListModel::addCall (const shared_ptr<linphone::Call> &linphoneCall) {
qInfo() << "Add call:" << call;
App::getInstance()->getEngine()->setObjectOwnership(call, QQmlEngine::CppOwnership);
linphoneCall->setData("call-model", *call);
int row = mList.count();
......@@ -193,7 +192,6 @@ void CallsListModel::removeCall (const shared_ptr<linphone::Call> &linphoneCall)
QTimer::singleShot(
DELAY_BEFORE_REMOVE_CALL, this, [this, linphoneCall]() {
CallModel *call = &linphoneCall->getData<CallModel>("call-model");
linphoneCall->unsetData("call-model");
qInfo() << "Removing call:" << call;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment