Skip to content

Commit e839209

Browse files
committed
Merge branch 'albert-github-feature/issue_11683'
2 parents 41a489c + 6332a65 commit e839209

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/memberdef.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,11 +2614,13 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
26142614
)
26152615
{
26162616
auto parser { createDocParser() };
2617+
SearchIndexThreadLocal::setActive(inheritedFrom==nullptr);
26172618
auto ast { validatingParseDoc(*parser.get(),
26182619
briefFile(),briefLine(),
26192620
getOuterScope()?getOuterScope():d,
26202621
this,briefDescription(),TRUE,FALSE,
26212622
QCString(),TRUE,FALSE) };
2623+
SearchIndexThreadLocal::setActive(true);
26222624
if (!ast->isEmpty())
26232625
{
26242626
ol.startMemberDescription(anchor(),inheritId);

src/searchindex.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,15 @@ void SearchIndexExternal::write(const QCString &fileName)
537537

538538
//---------------------------------------------------------------------------------------------
539539

540+
namespace SearchIndexThreadLocal
541+
{
542+
static THREAD_LOCAL bool active = true;
543+
bool isActive() { return active; }
544+
void setActive(bool b) { active = b; }
545+
}
546+
547+
//---------------------------------------------------------------------------------------------
548+
540549
void initSearchIndexer()
541550
{
542551
bool searchEngine = Config_getBool(SEARCHENGINE);
@@ -552,3 +561,5 @@ void finalizeSearchIndexer()
552561
{
553562
Doxygen::searchIndex.setKind(SearchIndexIntf::Disabled);
554563
}
564+
565+

src/searchindex.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ struct SIData_Word
6161

6262
//-----------------------------
6363

64+
/** Namespace for per-thread control */
65+
namespace SearchIndexThreadLocal
66+
{
67+
bool isActive();
68+
void setActive(bool b);
69+
}
70+
6471
/** Writes search index for doxygen provided server based search engine that uses PHP. */
6572
class SearchIndex
6673
{
@@ -143,7 +150,7 @@ class SearchIndexIntf
143150
using SearchIndexVariant = std::variant<std::monostate,SearchIndex,SearchIndexExternal>;
144151
enum Kind { Disabled, Internal, External };
145152
SearchIndexIntf() : m_kind(Disabled) {}
146-
bool enabled() const { return m_kind!=Disabled; }
153+
bool enabled() const { return m_kind!=Disabled && SearchIndexThreadLocal::isActive(); }
147154

148155
void setCurrentDoc(const Definition *ctx,const QCString &anchor,bool isSourceFile)
149156
{

0 commit comments

Comments
 (0)