[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - ios/ios.h ios/ios.mm kit/Kit.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Mar 5 07:30:39 UTC 2019
ios/ios.h | 4 +---
ios/ios.mm | 2 +-
kit/Kit.cpp | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
New commits:
commit cff49659b0971cd2541eb2bee277bda388a2be43
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Feb 26 14:02:26 2019 +0200
Commit: Tor Lillqvist <tml at iki.fi>
CommitDate: Tue Mar 5 09:15:43 2019 +0200
Fix crash in iOS app: Just use a raw pointer as the lok_document hack
The lok_document pointer will only be used when it is valid anyway.
Fixes a crash when you open a second document after closing the first.
Change-Id: I362db282e4eccf419b56bf790ea58181594ab0fe
diff --git a/ios/ios.h b/ios/ios.h
index 0be3d6343..8bf7e147d 100644
--- a/ios/ios.h
+++ b/ios/ios.h
@@ -7,14 +7,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <memory>
-
#include <LibreOfficeKit/LibreOfficeKit.hxx>
extern const char *lo_ios_app_getCacheDir();
extern int loolwsd_server_socket_fd;
-extern std::shared_ptr<lok::Document> lok_document;
+extern lok::Document *lok_document;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/ios.mm b/ios/ios.mm
index 9d9e87e7a..c49e30fc5 100644
--- a/ios/ios.mm
+++ b/ios/ios.mm
@@ -18,7 +18,7 @@ extern "C" {
}
int loolwsd_server_socket_fd = -1;
-std::shared_ptr<lok::Document> lok_document;
+lok::Document *lok_document;
const char* lo_ios_app_getCacheDir()
{
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index a41283ed2..228af098e 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1678,7 +1678,7 @@ private:
#ifdef IOS
// The iOS app (and the Android one) has max one document open at a time, so we can keep
// a pointer to it in a global.
- lok_document = _loKitDocument;
+ lok_document = _loKitDocument.get();
#endif
if (!_loKitDocument || !_loKitDocument->get())
{
More information about the Libreoffice-commits
mailing list