diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 0f59515dcc15..b1dce0de8543 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -241,7 +241,7 @@ GrammarCheckingIterator::GrammarCheckingIterator() : m_aEventListeners( MyMutex::get() ), m_aNotifyListeners( MyMutex::get() ) { - m_thread = osl_createThread( lcl_workerfunc, this ); + m_thread = nullptr; } @@ -321,6 +321,8 @@ void GrammarCheckingIterator::AddEntry( // add new entry to the end of this queue ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); + if (!m_thread) + m_thread = osl_createThread( lcl_workerfunc, this ); m_aFPEntriesQueue.push_back( aNewFPEntry ); // wake up the thread in order to do grammar checking