[Libreoffice-commits] online.git: kit/Kit.cpp

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 29 11:23:46 UTC 2019


 kit/Kit.cpp |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 908240741daba5e8b9991bc0979a506b62bf1c72
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Sep 26 17:39:41 2019 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Sep 29 13:23:25 2019 +0200

    tdf#125575: Must reset the "kit" callback to null when closing document
    
    As we register the global "kit" callback with the Document object
    pointer as callback data, we must unregister it when the document is
    being "unloaded" and the Document object will destruct shortly.
    Otherwise the callback might be called for the next document with a
    stale pointer.
    
    Relevant only for the iOS app, and presumably the Android one. In
    web-based Online, the kit process will exit anyway after the document
    is closed. But in an app there is just one process that keeps running
    for a long time handling all documents that are edited.
    
    For some reason the crash only showed up when a document was created
    from a template, closed, and another document was created from a
    template.
    
    Change-Id: Ieb47838a597c5bcab89c1a33d9bc2f2adb57b3b3
    Reviewed-on: https://gerrit.libreoffice.org/79633
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit ee497b873eadfa3ab4ba77793748e83ff649dacf)
    Reviewed-on: https://gerrit.libreoffice.org/79650
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 0dd75ff7b..2a26b7118 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1524,6 +1524,7 @@ private:
 
         _loKitDocument->setView(viewId);
         _loKitDocument->registerCallback(nullptr, nullptr);
+        _loKit->registerCallback(nullptr, nullptr);
 
         int viewCount = _loKitDocument->getViewsCount();
         if (viewCount == 1)


More information about the Libreoffice-commits mailing list