Browse Source

Fix XFile name for $ and {}
Memleak copy constructor

Madrich 10 years ago
parent
commit
c4eb04bb8c
2 changed files with 7 additions and 6 deletions
  1. 4 6
      code/Exporter.cpp
  2. 3 0
      code/XFileExporter.cpp

+ 4 - 6
code/Exporter.cpp

@@ -495,13 +495,11 @@ void Exporter :: UnregisterExporter(const char* id)
 ExportProperties :: ExportProperties() {}
 
 ExportProperties::ExportProperties(const ExportProperties &other)
+	 : mIntProperties(other.mIntProperties),
+   mFloatProperties(other.mFloatProperties),
+   mStringProperties(other.mStringProperties),
+   mMatrixProperties(other.mMatrixProperties)
 {
-	new(this) ExportProperties();
-	
-	mIntProperties    = other.mIntProperties;
-	mFloatProperties  = other.mFloatProperties;
-	mStringProperties = other.mStringProperties;
-	mMatrixProperties = other.mMatrixProperties;
 	
 }
 

+ 3 - 0
code/XFileExporter.cpp

@@ -510,6 +510,9 @@ std::string XFileExporter::toXFileString(aiString &name)
 	std::string str = std::string(name.C_Str());
 	std::replace(str.begin(), str.end(), '<', '_');
 	std::replace(str.begin(), str.end(), '>', '_');
+	std::replace(str.begin(), str.end(), '{', '_');
+	std::replace(str.begin(), str.end(), '}', '_');
+	std::replace(str.begin(), str.end(), '$', '_');
 	return str;
 }