diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-01 10:04:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-01 12:04:10 +0200 |
commit | 945d7d44072e7a8d7d460c662729ad3cc7334ba2 (patch) | |
tree | dace384bed9505daeab39cdc70b26b5fa83abcf0 /sfx2 | |
parent | 2da960dbf792f07cc16b2b2743f83041286de1a1 (diff) |
sfx2: nullptr pViewShell was seen in SfxLokHelper::getView()
I'm not sure how to trigger this reliably, but Pranav got this:
#0 0x00007fb2f471bbf0 in SfxLokHelper::getView(SfxViewShell*) (pViewShell=0x0) at sfx2/source/view/lokhelper.cxx:82
#1 0x00007fb2f75edf4f in doc_paintPartTile(LibreOfficeKitDocument*, unsigned char*, int, int, int, int, int, int, int) (pThis=0x7fb290253c40, pBuffer=0x281fbd0 "", nPart=0, nCanvasWidth=1024, nCanvasHeight=256, nTilePosX=0, nTilePosY=11520, nTileWidth=15360, nTileHeight=3840) at desktop/source/lib/init.cxx:1338
Given that SfxViewShell::Current() may indeed return nullptr (e.g.
during shutdown), change SfxLokHelper::getView() to return -1 in that
case, and adapt client code to handle that.
Change-Id: Ia191c843c8a993f3d7157de432af57964c0a8f63
Reviewed-on: https://gerrit.libreoffice.org/28583
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit f96fa389f950dd97bd213402fb5ea6eb114f9ab7)
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 68707875bf0d..0e7af55e4682 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -79,6 +79,10 @@ int SfxLokHelper::getView(SfxViewShell* pViewShell) { if (!pViewShell) pViewShell = SfxViewShell::Current(); + // Still no valid view shell? Then no idea. + if (!pViewShell) + return -1; + return pViewShell->GetViewShellId(); } |