[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1609
Date       : Sun Jul 30 10:47:04 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/rndrgn.cpp
   M /Trunk/XaraLX/wxOil/camelot.cpp
   M /Trunk/XaraLX/wxOil/camview.cpp

More valgrind fixes


Diff:
Index: Trunk/XaraLX/Kernel/rndrgn.cpp
===================================================================
--- Trunk/XaraLX/Kernel/rndrgn.cpp	(revision 1608)
+++ Trunk/XaraLX/Kernel/rndrgn.cpp	(revision 1609)
@@ -314,14 +314,15 @@
 	// By default try to render everything
 	RenderComplexShapes = TRUE;
 
+	TRACEUSER("Gavin",_T("RenderRegion::RenderRegion - RenderFlags.Rendering = FALSE;
"));
 	RenderFlags.Printing = FALSE;
-	TRACEUSER("Gavin",_T("RenderRegion::RenderRegion - RenderFlags.Rendering = FALSE;
"));
 	RenderFlags.Rendering = FALSE;
+	RenderFlags.StackClaimed = FALSE;
+	RenderFlags.ValidDevice = FALSE;
 	RenderFlags.bImmediateRender = FALSE;
-	RenderFlags.ValidDevice = FALSE;
 	RenderFlags.VeryMono = FALSE;
+	RenderFlags.SmoothedBitmaps = FALSE;
 	RenderFlags.HitDetect = FALSE;
-	RenderFlags.SmoothedBitmaps = FALSE;
 
 	// All fill attributes are invalid to start with.
 	FillFlags.ValidGeometry 		= FALSE;
@@ -435,14 +436,15 @@
 	RenderDC = NULL;
 	m_fOwned = FALSE;
 
+	TRACEUSER("Gavin",_T("RenderRegion::RenderRegion - RenderFlags.Rendering = FALSE;
"));
 	RenderFlags.Printing = FALSE;
-	TRACEUSER("Gavin",_T("RenderRegion::RenderRegion - RenderFlags.Rendering = FALSE;
"));
 	RenderFlags.Rendering = FALSE;
+	RenderFlags.StackClaimed = FALSE;
+	RenderFlags.ValidDevice = FALSE;
 	RenderFlags.bImmediateRender = FALSE;
-	RenderFlags.ValidDevice = FALSE;
 	RenderFlags.VeryMono = FALSE;
+	RenderFlags.SmoothedBitmaps = FALSE;
 	RenderFlags.HitDetect = FALSE;
-	RenderFlags.SmoothedBitmaps = FALSE;
 
 	DrawingMode = DM_COPYPEN;
 
Index: Trunk/XaraLX/wxOil/camview.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camview.cpp	(revision 1608)
+++ Trunk/XaraLX/wxOil/camview.cpp	(revision 1609)
@@ -249,6 +249,7 @@
 	m_LastMouseUsedTimestamp=0;
 	m_CouldSkipNextMouse=FALSE;
 
+	OldOffset = WorkCoord(0, 0); // need to initialize it to something
 }
 
 /*********************************************************************************************
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp	(revision 1608)
+++ Trunk/XaraLX/wxOil/camelot.cpp	(revision 1609)
@@ -769,18 +769,23 @@
 	if( bFirstRun || m_strResourceDirPath == _T("") || !wxDir::Exists( (PCTSTR)m_strResourceDirPath ) )
 	{
 #if !defined(RESOURCE_DIR)
-		std::auto_ptr<char> pszDataPath( br_find_data_dir( "/usr/share" ) );
-		m_strResourceDirPath = ( pszDataPath.get() );
-		m_strResourceDirPath += _T("/xaralx");
-		TRACEUSER( "luke", _T("Using resource directory \"%s\"
"), PCTSTR(m_strResourceDirPath) );
-	#if defined(_DEBUG)
-		if( !wxDir::Exists( PCTSTR(m_strResourceDirPath) ) )
+		// we can't use auto pointers here because they free using delete but BR allocates using malloc (strdup actually)
+		char * pszDataPath = br_find_data_dir( "/usr/share" );
+		if (pszDataPath)
 		{
-			// We'll try default location under debug to make life easier
-			m_strResourceDirPath = _T("/usr/share/xaralx");
-			TRACEUSER( "luke", _T("Try = \"%s\"
"), PCTSTR(m_strResourceDirPath) );
+			m_strResourceDirPath = wxString( pszDataPath, wxConvFile );
+			free(pszDataPath);
+			m_strResourceDirPath += _T("/xaralx");
+			TRACEUSER( "luke", _T("Using resource directory \"%s\"
"), PCTSTR(m_strResourceDirPath) );
+#if defined(_DEBUG)
+			if( !wxDir::Exists( PCTSTR(m_strResourceDirPath) ) )
+			{
+				// We'll try default location under debug to make life easier
+				m_strResourceDirPath = _T("/usr/share/xaralx");
+				TRACEUSER( "luke", _T("Try = \"%s\"
"), PCTSTR(m_strResourceDirPath) );
+			}
+#endif
 		}
-	#endif
 #else
 		// The "" is needed to stop the macro expanding to LRESOURCE_DIR
 		m_strResourceDirPath = _T(""RESOURCE_DIR);


Xara