clear app lists on restart (fix crash where signals are catch while core has not started yet)

This commit is contained in:
Gaelle Braud 2025-12-19 08:23:53 +01:00
parent e32ed7f6a1
commit bd87f3c6c3
5 changed files with 67 additions and 47 deletions

View file

@ -966,6 +966,10 @@ void App::restart() {
closeCallsWindow();
setMainWindow(nullptr);
setCoreStarted(false);
if (mAccountList) mAccountList->resetData();
if (mCallList) mCallList->resetData();
if (mChatList) mChatList->resetData();
if (mConferenceInfoList) mConferenceInfoList->resetData();
mEngine->clearComponentCache();
mEngine->clearSingletons();
delete mEngine;
@ -1265,11 +1269,24 @@ void App::onAuthenticationRequested(const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::AuthInfo> &authInfo,
linphone::AuthMethod method) {
bool authInfoIsInAccounts = false;
for (auto &account : core->getAccountList()) {
auto accountAuthInfo = account->findAuthInfo();
if (authInfo && accountAuthInfo && authInfo->isEqualButAlgorithms(accountAuthInfo)) {
authInfoIsInAccounts = true;
break;
if (authInfo) {
for (auto &account : core->getAccountList()) {
if (!account) continue;
auto accountAuthInfo = account->findAuthInfo();
if (accountAuthInfo) {
if (authInfo->isEqualButAlgorithms(accountAuthInfo)) {
authInfoIsInAccounts = true;
break;
}
} else {
auto identityAddress = account->getParams()->getIdentityAddress();
if (!identityAddress) continue;
if (authInfo->getUsername() == identityAddress->getUsername() &&
authInfo->getDomain() == identityAddress->getDomain()) {
authInfoIsInAccounts = true;
break;
}
}
}
}
if (!authInfoIsInAccounts) return;

View file

@ -40,6 +40,9 @@ public:
void setSelf(QSharedPointer<ConferenceInfoList> me);
void resetData(QList<QSharedPointer<ConferenceInfoCore>> data);
void resetData() override {
ListProxy::resetData();
}
void addConference(const std::shared_ptr<linphone::ConferenceInfo> &confInfo);

View file

@ -735,80 +735,80 @@
<translation>nicht erreichbar</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="990"/>
<location filename="../../core/App.cpp" line="994"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>Ein kostenloses Open-Source SIP Video-Telefon.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="992"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Kommandozeilen-Befehl an die Anwendung schicken</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="996"/>
<location filename="../../core/App.cpp" line="1000"/>
<source>command_line_option_show_help</source>
<translation>Zeige Hilfe</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1001"/>
<location filename="../../core/App.cpp" line="1005"/>
<source>command_line_option_show_app_version</source>
<translation>App-Version anzeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1009"/>
<location filename="../../core/App.cpp" line="1013"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1011"/>
<location filename="../../core/App.cpp" line="1015"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, Pfad oder Datei</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1016"/>
<location filename="../../core/App.cpp" line="1020"/>
<source>command_line_option_minimized</source>
<translation>Minimieren</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1019"/>
<location filename="../../core/App.cpp" line="1023"/>
<source>command_line_option_log_to_stdout</source>
<translation>Debug-Informationen auf der Standardausgabe ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1022"/>
<location filename="../../core/App.cpp" line="1026"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Nur Anwendungs-Logs ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1453"/>
<location filename="../../core/App.cpp" line="1470"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Ausblenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1453"/>
<location filename="../../core/App.cpp" line="1470"/>
<source>show_action</source>
<translation>Zeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1468"/>
<location filename="../../core/App.cpp" line="1485"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Beenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1486"/>
<location filename="../../core/App.cpp" line="1503"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Auf Updates prüfen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1609"/>
<location filename="../../core/App.cpp" line="1626"/>
<source>mark_all_read_action</source>
<translation>Alle als gelesen markieren</translation>
</message>

View file

@ -716,80 +716,80 @@
<translation>not reachable</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="990"/>
<location filename="../../core/App.cpp" line="994"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="992"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="996"/>
<location filename="../../core/App.cpp" line="1000"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1001"/>
<location filename="../../core/App.cpp" line="1005"/>
<source>command_line_option_show_app_version</source>
<translation>Show app version</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1009"/>
<location filename="../../core/App.cpp" line="1013"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1011"/>
<location filename="../../core/App.cpp" line="1015"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1016"/>
<location filename="../../core/App.cpp" line="1020"/>
<source>command_line_option_minimized</source>
<translation>Minimize</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1019"/>
<location filename="../../core/App.cpp" line="1023"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1022"/>
<location filename="../../core/App.cpp" line="1026"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1453"/>
<location filename="../../core/App.cpp" line="1470"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Hide</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1453"/>
<location filename="../../core/App.cpp" line="1470"/>
<source>show_action</source>
<translation>Show</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1468"/>
<location filename="../../core/App.cpp" line="1485"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quit</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1486"/>
<location filename="../../core/App.cpp" line="1503"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Check for update</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1609"/>
<location filename="../../core/App.cpp" line="1626"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>

View file

@ -711,80 +711,80 @@
<translation>indisponible</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="990"/>
<location filename="../../core/App.cpp" line="994"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="992"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="996"/>
<location filename="../../core/App.cpp" line="1000"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1001"/>
<location filename="../../core/App.cpp" line="1005"/>
<source>command_line_option_show_app_version</source>
<translation>Afficher la version de l&apos;application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1009"/>
<location filename="../../core/App.cpp" line="1013"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1011"/>
<location filename="../../core/App.cpp" line="1015"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1016"/>
<location filename="../../core/App.cpp" line="1020"/>
<source>command_line_option_minimized</source>
<translation>Minimiser</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1019"/>
<location filename="../../core/App.cpp" line="1023"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1022"/>
<location filename="../../core/App.cpp" line="1026"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1453"/>
<location filename="../../core/App.cpp" line="1470"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Cacher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1453"/>
<location filename="../../core/App.cpp" line="1470"/>
<source>show_action</source>
<translation>Afficher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1468"/>
<location filename="../../core/App.cpp" line="1485"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quitter</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1486"/>
<location filename="../../core/App.cpp" line="1503"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Rechercher une mise à jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1609"/>
<location filename="../../core/App.cpp" line="1626"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>