diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-05-14 13:34:46 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-05-14 13:54:21 +0200 |
commit | 6a95ebee89aa941ee1a30476997f07eb99acc00b (patch) | |
tree | 35a067bb2235d8cc717cec66f82f2648010b838d /vcl/source | |
parent | 3f329e4a3cb7c43927e75b8c359e58d16716a8dd (diff) |
Introduce vcl::lok::unregisterPollCallbacks() and clarify isUnipoll()
There was a problem in the iOS app where a callback was done passing a
registered mpPollClosure that pointed to the mainKit variable in
lokit_main() even though that variable had already gone out of scope
and been destructed.
Introduce unregisterPollCallbacks(), which just sets the mpPollClosure
pointer to null. That means no callbacks should be done any more. It
does not mean that Unipoll would not be active. Change isUnipoll() to
look at whether the mpPollCallback pointer has been set or not.
Change-Id: I5d5527c0ef097682679371dc642f8896ff05450d
Reviewed-on: https://gerrit.libreoffice.org/72283
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/svapp.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index ea094534833e..ceeaada7da58 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1727,10 +1727,23 @@ void registerPollCallbacks( } } +void unregisterPollCallbacks() +{ + ImplSVData * pSVData = ImplGetSVData(); + if (pSVData) + { + // Just set mpPollClosure to null as that is what calling this means, that the callback data + // points to an object that no longer exists. In particular, don't set + // pSVData->mpPollCallback to nullptr as that is used to detect whether Unipoll is in use in + // isUnipoll(). + pSVData->mpPollClosure = nullptr; + } +} + bool isUnipoll() { ImplSVData * pSVData = ImplGetSVData(); - return pSVData && pSVData->mpPollClosure != nullptr; + return pSVData && pSVData->mpPollCallback != nullptr; } } } // namespace lok, namespace vcl |