[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sd/source
Michael Stahl
mstahl at redhat.com
Wed Jul 10 07:01:18 PDT 2013
sd/source/ui/slidesorter/controller/SlsListener.cxx | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit d9b36d3623ce5d88bfaca7a31426fa126a6ce4ac
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Jul 10 15:43:42 2013 +0200
rhbz#965646: sd: unregister slide sorter listener to avoid crashes
sd::slidesorter::controller::Listener::Notify(): when the ~SdDrawDocument
sends a HINT_MODELCLEARED, unregister since the document doesn't exist
any more. This should hopefully avoids accessing a SfxViewShell
instance that has apparently already been deleted somewhere in one of
the listeners.
Change-Id: I0ba9a58d77741a52b652a6c55c2327db80859011
(cherry picked from commit a9e0c222f504104124485ef4684ce6f79d3dee52)
Reviewed-on: https://gerrit.libreoffice.org/4813
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index 17a8a14..e85a6c8 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -304,6 +304,13 @@ void Listener::Notify (
SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
switch (rSdrHint.GetKind())
{
+ case HINT_MODELCLEARED:
+ if (&rBroadcaster == mrSlideSorter.GetModel().GetDocument())
+ { // rhbz#965646 stop listening to dying document
+ EndListening(rBroadcaster);
+ return;
+ }
+ break;
case HINT_PAGEORDERCHG:
if (&rBroadcaster == mrSlideSorter.GetModel().GetDocument())
HandleModelChange(rSdrHint.GetPage());
More information about the Libreoffice-commits
mailing list