Skip to content

Commit

Permalink
When forkit installs fonts, sparekits that already exist don't get them
Browse files Browse the repository at this point in the history
at least the first spare kit created by forkit_main will exist without
the fonts which arrive later

Signed-off-by: Caolán McNamara <[email protected]>
Change-Id: Idd778a40791266b0e2ff7ec6ba02dca6a19d0f23
  • Loading branch information
caolanm authored and mmeeks committed Nov 5, 2024
1 parent e3c051b commit 0ebe822
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions wsd/COOLWSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,14 @@ class RemoteJSONPoll : public SocketPoll
std::string _expectedKind;
};

static void requestTerminateSpareKits()
{
std::unique_lock<std::mutex> lock(NewChildrenMutex);
const int count = NewChildren.size();
for (int i = count - 1; i >= 0; --i)
NewChildren[i]->requestTermination();
}

class RemoteConfigPoll : public RemoteJSONPoll
{
public:
Expand Down Expand Up @@ -1873,6 +1881,13 @@ class RemoteFontConfigPoll : public RemoteJSONPoll

COOLWSD::sendMessageToForKit("addfont " + fontFile);

// Request existing spare kits to quit, to get replaced with ones that
// include the new fonts.
if (PrisonerPoll)
{
PrisonerPoll->addCallback([]{ requestTerminateSpareKits(); });
}

return true;
}

Expand Down

0 comments on commit 0ebe822

Please sign in to comment.