https://bugs.documentfoundation.org/show_bug.cgi?id=91416

Julien Nabet <serval2...@yahoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |michael.me...@collabora.com

--- Comment #8 from Julien Nabet <serval2...@yahoo.fr> ---
Michael: 
noticing that pVirtDev were ScopedVclPtrInstance in all the other locations
than editeng/source/editeng/impedit.hxx, I tried this patch:
diff --git a/editeng/source/editeng/impedit.hxx
b/editeng/source/editeng/impedit.hxx
index c6186b9..4fdc3dd 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -422,7 +422,7 @@ private:
     SfxStyleSheetPool*  pStylePool;
     SfxItemPool*        pTextObjectPool;

-    VclPtr< VirtualDevice> pVirtDev;
+    ScopedVclPtrInstance< VirtualDevice> pVirtDev;
     VclPtr< OutputDevice > pRefDev;

     svtools::ColorConfig*   pColorConfig;
@@ -1068,9 +1068,6 @@ inline EditSelection ImpEditEngine::CreateSel( const
ESelection& rSel )

 inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode&
rMapMode, DrawModeFlags nDrawMode )
 {
-    if ( !pVirtDev )
-        pVirtDev = new VirtualDevice;
-
     if ( ( pVirtDev->GetMapMode().GetMapUnit() != rMapMode.GetMapUnit() ) ||
          ( pVirtDev->GetMapMode().GetScaleX() != rMapMode.GetScaleX() ) ||
          ( pVirtDev->GetMapMode().GetScaleY() != rMapMode.GetScaleY() ) )
diff --git a/editeng/source/editeng/impedit2.cxx
b/editeng/source/editeng/impedit2.cxx
index 7905893..81102ab 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -106,7 +106,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool*
pItemPool ) :
 {
     pEditEngine         = pEE;
     pRefDev             = NULL;
-    pVirtDev            = NULL;
     pEmptyItemSet       = NULL;
     pActiveView         = NULL;
     pSpellInfo          = NULL;

I still got a crash but with a different bt.
Anyway, is this patch ok for VclPtr management?

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to