From bd87f3c6c3f4562bc4798af1eeea022571f5e21d Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Fri, 19 Dec 2025 08:23:53 +0100 Subject: [PATCH] clear app lists on restart (fix crash where signals are catch while core has not started yet) --- Linphone/core/App.cpp | 27 ++++++++++++++---- .../core/conference/ConferenceInfoList.hpp | 3 ++ Linphone/data/languages/de.ts | 28 +++++++++---------- Linphone/data/languages/en.ts | 28 +++++++++---------- Linphone/data/languages/fr.ts | 28 +++++++++---------- 5 files changed, 67 insertions(+), 47 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 7fffbcf11..330a776b5 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -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 &core, const std::shared_ptr &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; diff --git a/Linphone/core/conference/ConferenceInfoList.hpp b/Linphone/core/conference/ConferenceInfoList.hpp index da57e7818..ca0b2796c 100644 --- a/Linphone/core/conference/ConferenceInfoList.hpp +++ b/Linphone/core/conference/ConferenceInfoList.hpp @@ -40,6 +40,9 @@ public: void setSelf(QSharedPointer me); void resetData(QList> data); + void resetData() override { + ListProxy::resetData(); + } void addConference(const std::shared_ptr &confInfo); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 4b01e371f..c4562adfc 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -735,80 +735,80 @@ nicht erreichbar - + application_description "A free and open source SIP video-phone." Ein kostenloses Open-Source SIP Video-Telefon. - + command_line_arg_order "Send an order to the application towards a command line" Kommandozeilen-Befehl an die Anwendung schicken - + command_line_option_show_help Zeige Hilfe - + command_line_option_show_app_version App-Version anzeigen - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, Pfad oder Datei - + command_line_option_minimized Minimieren - + command_line_option_log_to_stdout Debug-Informationen auf der Standardausgabe ausgeben - + command_line_option_print_app_logs_only "Print only logs from the application" Nur Anwendungs-Logs ausgeben - + hide_action "Cacher" "Afficher" Ausblenden - + show_action Zeigen - + quit_action "Quitter" Beenden - + check_for_update Check for update Auf Updates prüfen - + mark_all_read_action Alle als gelesen markieren diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 0e98a9f6f..ac8a7a400 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -716,80 +716,80 @@ not reachable - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Show app version - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimize - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Hide - + show_action Show - + quit_action "Quitter" Quit - + check_for_update Check for update Check for update - + mark_all_read_action Marquer tout comme lu diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index dabfb6be7..a1db3e5f8 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -711,80 +711,80 @@ indisponible - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Afficher la version de l'application - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimiser - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Cacher - + show_action Afficher - + quit_action "Quitter" Quitter - + check_for_update Check for update Rechercher une mise à jour - + mark_all_read_action Marquer tout comme lu