fix(RemoteConferenceEventHandler): remove listener only if core exists + add me in main db tests

This commit is contained in:
Ronan Abhamon 2018-02-02 10:53:47 +01:00
parent e62d8fffd7
commit c9c4ab5536
3 changed files with 7 additions and 2 deletions

View file

@ -233,7 +233,12 @@ Object(*new RemoteConferenceEventHandlerPrivate) {
RemoteConferenceEventHandler::~RemoteConferenceEventHandler () {
L_D();
d->conf->getCore()->getPrivate()->unregisterListener(d);
try {
d->conf->getCore()->getPrivate()->unregisterListener(d);
} catch (const bad_weak_ptr &) {
// Unable to unregister listener here. Core is destroyed and the listener doesn't exist.
}
if (d->lev)
unsubscribe();

View file

@ -56,7 +56,7 @@ shared_ptr<Core> CoreAccessor::getCore () const {
shared_ptr<Core> core = d->core.lock();
if (!core) {
lWarning() << "Unable to get valid core instance.";
throw std::bad_weak_ptr();
throw bad_weak_ptr();
}
return core;

Binary file not shown.