catch exception when core not valid anymore

This commit is contained in:
Benjamin Reis 2018-03-19 17:30:30 +01:00
parent fe3bf89ccc
commit 6caeebd5ef

View file

@ -225,7 +225,12 @@ ClientGroupChatRoom::~ClientGroupChatRoom () {
L_D();
L_D_T(RemoteConference, dConference);
getCore()->getPrivate()->remoteListEventHandler->removeHandler(dConference->eventHandler.get());
try {
if (getCore()->getPrivate()->remoteListEventHandler)
getCore()->getPrivate()->remoteListEventHandler->removeHandler(dConference->eventHandler.get());
} catch (const bad_weak_ptr &) {
// Unable to unregister listener here. Core is destroyed and the listener doesn't exist.
}
d->setCallSessionListener(nullptr);
}