diff --git a/linphone-desktop/src/components/call/CallModel.cpp b/linphone-desktop/src/components/call/CallModel.cpp index 55e73fc99..19033635f 100644 --- a/linphone-desktop/src/components/call/CallModel.cpp +++ b/linphone-desktop/src/components/call/CallModel.cpp @@ -108,6 +108,10 @@ CallModel::CallModel (shared_ptr linphoneCall) { ); } +CallModel::~CallModel () { + mLinphoneCall->unsetData("call-model"); +} + // ----------------------------------------------------------------------------- void CallModel::setRecordFile (shared_ptr &callParams) { diff --git a/linphone-desktop/src/components/call/CallModel.hpp b/linphone-desktop/src/components/call/CallModel.hpp index ab57090b1..27314eeaf 100644 --- a/linphone-desktop/src/components/call/CallModel.hpp +++ b/linphone-desktop/src/components/call/CallModel.hpp @@ -65,7 +65,7 @@ public: Q_ENUM(CallStatus); CallModel (std::shared_ptr linphoneCall); - ~CallModel () = default; + ~CallModel (); std::shared_ptr getLinphoneCall () const { return mLinphoneCall; diff --git a/linphone-desktop/src/components/calls/CallsListModel.cpp b/linphone-desktop/src/components/calls/CallsListModel.cpp index 8f2267f97..d30ea3886 100644 --- a/linphone-desktop/src/components/calls/CallsListModel.cpp +++ b/linphone-desktop/src/components/calls/CallsListModel.cpp @@ -179,7 +179,6 @@ void CallsListModel::addCall (const shared_ptr &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 &linphoneCall) QTimer::singleShot( DELAY_BEFORE_REMOVE_CALL, this, [this, linphoneCall]() { CallModel *call = &linphoneCall->getData("call-model"); - linphoneCall->unsetData("call-model"); qInfo() << "Removing call:" << call;