summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-10-15 10:55:42 +0300
committerTor Lillqvist <tml@collabora.com>2014-10-15 15:42:00 +0300
commit0664f5afb2f036288a5e69a4448928e0b8223048 (patch)
treefa671d38cb8ffbf62a09eac5025552ccc13e70e2
parentDon't keep the LibreOfficeKit pointer in a global variable (diff)
downloadcore-0664f5afb2f036288a5e69a4448928e0b8223048.tar.gz
core-0664f5afb2f036288a5e69a4448928e0b8223048.zip
The 'bInitialized' state needs to be global, and unset in lo_destroy()
I assume, for lo_destroy() to be useful at all. Not that I know for sure what the exact intended semantics of lo_destroy() and lo_initialize() are. But I assume that the idea is that after lo_destroy() has been called, lo_initialize() can be called again. Change-Id: I2dea26db150d19ed438427e1c119a5297b9bc9c3
-rw-r--r--desktop/source/lib/init.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 96135143d6fd..fd6bbb088579 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -655,11 +655,12 @@ static void* lo_startmain(void*)
return 0;
}
+static bool bInitialized = false;
+
static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
{
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
- static bool bInitialized = false;
if (bInitialized)
return 1;
@@ -778,10 +779,14 @@ static void lo_destroy(LibreOfficeKit *pThis)
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
gImpl = NULL;
+ SAL_INFO("lok", "lo_destroy");
+
Application::Quit();
pthread_join(pLib->maThread, NULL);
delete pLib;
+ bInitialized = false;
+ SAL_INFO("lok", "lo_destroy done");
}
}