1. mst
  2. ooo340

Commits

rt  committed 6fde867

#i10000# Work around crash at exit.

  • Participants
  • Parent commits 5f5cac7
  • Branches default

Comments (0)

Files changed (1)

File svx/source/sdr/primitive2d/sdrprimitivetools.cxx

View file
  • Ignore whitespace
 	{
 		BitmapEx createDefaultCross_3x3(const basegfx::BColor& rBColor)
 		{
-			static BitmapEx aRetval;
+			static BitmapEx* pRetVal = NULL;
 			static basegfx::BColor aColor;
 		    ::osl::Mutex m_mutex;
 
-			if(aRetval.IsEmpty() || rBColor != aColor)
+			if(pRetVal == NULL || rBColor != aColor)
 			{
 				// copy values
 				aColor = rBColor;
 				aContent.ReleaseAccess(pWContent);
 				aMask.ReleaseAccess(pWMask);
 
-				aRetval = BitmapEx(aContent, aMask);
+                if( pRetVal )
+                    delete pRetVal;
+
+				pRetVal = new BitmapEx(aContent, aMask);
 			}
 
-			return aRetval;
+			return *pRetVal;
 		}
 
 		BitmapEx createDefaultGluepoint_7x7(const basegfx::BColor& rBColorA, const basegfx::BColor& rBColorB)
 		{
-			static BitmapEx aRetval;
+			static BitmapEx* pRetVal = NULL;
 			static basegfx::BColor aColorA;
 			static basegfx::BColor aColorB;
 		    ::osl::Mutex m_mutex;
 
-			if(aRetval.IsEmpty() || rBColorA != aColorA || rBColorB != aColorB)
+			if(pRetVal == NULL || rBColorA != aColorA || rBColorB != aColorB)
 			{
 				// copy values
 				aColorA = rBColorA;
 				aContent.ReleaseAccess(pWContent);
 				aMask.ReleaseAccess(pWMask);
 
-				aRetval = BitmapEx(aContent, aMask);
+                if( pRetVal )
+                    delete pRetVal;
+
+				pRetVal = new BitmapEx(aContent, aMask);
 			}
 
-			return aRetval;
+			return *pRetVal;
 		}
 	} // end of namespace primitive2d
 } // end of namespace drawinglayer