Skip to content

Commit

Permalink
fix: 多次调用单例实例导致的应用启动不了
Browse files Browse the repository at this point in the history
同一进程多次调用单例实例导致的应用启动不了。
主要在于应用使用旧的接口未更新,库的接口被依赖更新时发生的部分应用启动不了。

Influence: 所有 dtk 设置了单实例的应用

Log:
Change-Id: Ie7a97aec12ac584bbe8278c5144bc9288db614aa
  • Loading branch information
AlexOne committed Oct 16, 2021
1 parent acfd35c commit 71eabfd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/kernel/dguiapplicationhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,13 @@ DGuiApplicationHelper::ColorType DGuiApplicationHelper::paletteType() const
*/
bool DGuiApplicationHelper::setSingleInstance(const QString &key, DGuiApplicationHelper::SingleScope singleScope)
{
// for bug: 多次调用导致的控制中心起不来. 原则上禁止多次调用.
static bool multiCallFlag = false;
if (multiCallFlag) {
return true;
}
multiCallFlag = true;

bool new_server = !_d_singleServer.exists();

if (_d_singleServer->isListening()) {
Expand Down

0 comments on commit 71eabfd

Please sign in to comment.