[xiph-commits] r8335 - in trunk/oggdsf/src/lib: codecs/cmml/libCMMLTags codecs/cmml/libCMMLTagsDotNET helper/libiWrapper player/libDSPlayDotNET

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Mon Dec 6 02:45:10 PST 2004


Author: illiminable
Date: 2004-12-06 02:45:10 -0800 (Mon, 06 Dec 2004)
New Revision: 8335

Modified:
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp
   trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp
   trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp
Log:
* Fixed a marshalling problem passing naked wchar_t pointers to wrapper class.

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -41,6 +41,8 @@
 {
 	//Set the tag type
 	mTagType = C_CMMLTag::eTagType::ANCHOR;
+	mCls = L"";
+	mHref = L"";
 }
 
 C_AnchorTag::~C_AnchorTag(void)

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -38,6 +38,7 @@
 C_BaseTag::C_BaseTag(void)
 {
 	mTagType = C_CMMLTag::eTagType::BASE;
+	mHref = L"";
 }
 
 C_BaseTag::~C_BaseTag(void)

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -44,6 +44,7 @@
 	mImage = NULL;
 	mDesc = NULL;
 	mStart = L"0";
+	mTrack = L"";
 
 }
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -46,11 +46,15 @@
 
 	AnchorTag::~AnchorTag(void)
 	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+		mBaseClass = NULL;
 	}
 
-	AnchorTag::AnchorTag(C_AnchorTag* inTag) {
+	AnchorTag::AnchorTag(C_AnchorTag* inTag, bool inDeleteBase) {
 		mBaseClass = inTag;
+		mDeleteBase = inDeleteBase;
 	}
 
 	C_AnchorTag* AnchorTag::getMe() {
@@ -70,12 +74,14 @@
 	//Mutators
 	void AnchorTag::setCls(String* inCls) {
 		wchar_t* tc = Wrappers::netStrToWStr( inCls );
-		getMe()->setCls( tc );
+		wstring locStr = tc;
+		getMe()->setCls( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void AnchorTag::setHref(String* inHref) {
 		wchar_t* tc = Wrappers::netStrToWStr( inHref );
-		getMe()->setHref( tc );
+		wstring locStr = tc;
+		getMe()->setHref( locStr );
 		Wrappers::releaseWStr( tc );
 
 	}

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -77,7 +77,7 @@
 	{
 	public:
 		AnchorTag(void);
-		AnchorTag(C_AnchorTag* inTag);
+		AnchorTag(C_AnchorTag* inTag, bool inDeleteBase);
 		virtual ~AnchorTag(void);
 
 		//Accessors

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -43,12 +43,18 @@
 		mBaseClass = new C_BaseTag;
 	}
 
-	BaseTag::BaseTag(C_BaseTag* inTag) {
+	BaseTag::BaseTag(C_BaseTag* inTag, bool inDeleteBase) {
 		mBaseClass = inTag;
+		mDeleteBase = inDeleteBase;
 	}
 
 	BaseTag::~BaseTag(void)	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+
+
+		mBaseClass = NULL;
 	}
 
 	C_BaseTag* BaseTag::getMe() {
@@ -63,7 +69,8 @@
 	//Mutators
 	void BaseTag::setHref(String* inHref) {
 		wchar_t* tc = Wrappers::netStrToWStr( inHref );
-		getMe()->setHref( tc );
+		wstring locStr = tc;
+		getMe()->setHref( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -66,7 +66,7 @@
 	{
 	public:
 		BaseTag(void);
-		BaseTag(C_BaseTag* inTag);
+		BaseTag(C_BaseTag* inTag, bool inDeleteBase);
 		~BaseTag(void);
 
 		//Accessors

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -51,11 +51,11 @@
 
 CMMLPreamble* CMMLDoc::preamble() 
 {
-	return new CMMLPreamble(getMe()->preamble()->clone());
+	return new CMMLPreamble(getMe()->preamble(), false);
 }
 CMMLRootTag* CMMLDoc::root() 
 {
-	return new CMMLRootTag(getMe()->root()->clone());
+	return new CMMLRootTag(getMe()->root(), false);
 }
 
 void CMMLDoc::setRoot(CMMLRootTag* inRootTag) 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -41,9 +41,10 @@
 	CMMLPreamble::CMMLPreamble(void)
 	{
 	}
-	CMMLPreamble::CMMLPreamble(C_CMMLPreamble* inPreamble)
+	CMMLPreamble::CMMLPreamble(C_CMMLPreamble* inPreamble, bool inDeleteBase)
 	{
 		mBaseClass = inPreamble;
+		mDeleteBase = inDeleteBase;
 	}
 
 	CMMLPreamble::~CMMLPreamble(void)

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -64,7 +64,7 @@
 	{
 	public:
 		CMMLPreamble(void);
-		CMMLPreamble(C_CMMLPreamble* inPreamble);
+		CMMLPreamble(C_CMMLPreamble* inPreamble, bool inDeleteBase);
 		~CMMLPreamble(void);
 
 
@@ -84,6 +84,7 @@
 	protected:
 
 		C_CMMLPreamble* mBaseClass;
+		bool mDeleteBase;
 
 
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -43,27 +43,31 @@
 	mBaseClass = new C_CMMLRootTag;
 }
 
-CMMLRootTag::CMMLRootTag(C_CMMLRootTag* inRootTag)
+CMMLRootTag::CMMLRootTag(C_CMMLRootTag* inRootTag, bool inDeleteBase)
 {
 	mBaseClass = inRootTag;
+	mDeleteBase = inDeleteBase;
 }
 
 CMMLRootTag::~CMMLRootTag(void)
 
 {
-	delete mBaseClass;
+	if(mDeleteBase) {
+		delete mBaseClass;
+	}
+	mBaseClass = NULL;
 }
 
 		//Accessors
 	
 StreamTag* CMMLRootTag::stream() {
-	return new StreamTag(getMe()->stream()->clone());
+	return new StreamTag(getMe()->stream(), false);
 }
 HeadTag* CMMLRootTag::head() {
-	return new HeadTag(getMe()->head()->clone());
+	return new HeadTag(getMe()->head(), false);
 }
 ClipTagList* CMMLRootTag::clipList() {
-	return new ClipTagList(getMe()->clipList()->clone());
+	return new ClipTagList(getMe()->clipList(), false);
 
 }
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -55,7 +55,7 @@
 	{
 	public:
 		CMMLRootTag(void);
-		CMMLRootTag(C_CMMLRootTag* inRootTag);
+		CMMLRootTag(C_CMMLRootTag* inRootTag, bool inDeleteBase);
 		virtual ~CMMLRootTag(void);
 
 			//Accessors

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -56,7 +56,8 @@
 	//Mutators
 	void CMMLTag::setId(String* inId) {
 		wchar_t* tc = Wrappers::netStrToWStr( inId );
-		mBaseClass->setId( tc );
+		wstring locStr = tc;
+		mBaseClass->setId( locStr );
 		Wrappers::releaseWStr( tc );
 
 	}

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -119,6 +119,7 @@
 
 	protected:
 		C_CMMLTag* mBaseClass;
+		bool mDeleteBase;
 
 
 	};

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -41,10 +41,12 @@
 	ClipTag::ClipTag(void)
 	{
 		mBaseClass = new C_ClipTag;
+		mDeleteBase = true;
 	}
 
-	ClipTag::ClipTag(C_ClipTag* inTag) {
+	ClipTag::ClipTag(C_ClipTag* inTag, bool inDeleteBase) {
 		mBaseClass = inTag;
+		mDeleteBase = inDeleteBase;
 	}
 	ClipTag::~ClipTag(void)
 	{
@@ -60,16 +62,16 @@
 		return Wrappers::WStrToNetStr( getMe()->track().c_str() );
 	}
 	MetaTagList* ClipTag::metaList() {
-		return new MetaTagList(getMe()->metaList()->clone());
+		return new MetaTagList(getMe()->metaList(), false);
 	}
 	AnchorTag* ClipTag::anchor() {
-		return new AnchorTag(getMe()->anchor()->clone());
+		return new AnchorTag(getMe()->anchor(),false);
 	}
 	ImageTag* ClipTag::image() {
-		return new ImageTag(getMe()->image()->clone());
+		return new ImageTag(getMe()->image(), false);
 	}
 	DescTag* ClipTag::desc() {
-		return new DescTag(getMe()->desc()->clone());
+		return new DescTag(getMe()->desc(), false);
 	}
 
 	String* ClipTag::start() {
@@ -100,12 +102,14 @@
 
 	void ClipTag::setStart(String* inStart) {
 		wchar_t* tc = Wrappers::netStrToWStr( inStart );
-		getMe()->setStart( tc );
+		wstring locStr = tc;
+		getMe()->setStart( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void ClipTag::setEnd(String* inEnd) {
 		wchar_t* tc = Wrappers::netStrToWStr( inEnd );
-		getMe()->setEnd( tc );
+		wstring locStr = tc;
+		getMe()->setEnd( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -56,7 +56,7 @@
 	{
 	public:
 		ClipTag(void);
-		ClipTag(C_ClipTag* inTag);
+		ClipTag(C_ClipTag* inTag, bool inDeleteBase);
 		virtual ~ClipTag(void);
 
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -43,13 +43,18 @@
 		mBaseClass = new C_ClipTagList;
 	}
 
-	ClipTagList::ClipTagList(C_ClipTagList* inList)
+	ClipTagList::ClipTagList(C_ClipTagList* inList, bool inDeleteBase)
 	{
+		
 		mBaseClass = inList;
+		mDeleteBase = inDeleteBase;
 	}
 	ClipTagList::~ClipTagList(void)
 	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+		mBaseClass = NULL;
 	}
 
 
@@ -61,7 +66,7 @@
 		getMe()->addTag( inTag->getMe()->clone());
 	}
 	ClipTag* ClipTagList::getTag(unsigned long inTagNo) {
-		return new ClipTag( getMe()->getTag(inTagNo));
+		return new ClipTag( getMe()->getTag(inTagNo), false);
 	}
 
 	C_ClipTagList* ClipTagList::getMe() {

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -54,7 +54,7 @@
 	{
 	public:
 		ClipTagList(void);
-		ClipTagList(C_ClipTagList* inList);
+		ClipTagList(C_ClipTagList* inList, bool inDeleteBase);
 		virtual ~ClipTagList(void);
 
 		virtual String* toString();

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -45,11 +45,15 @@
 
 	DescTag::~DescTag(void)
 	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+		mDeleteBase = NULL;
 	}
 
-	DescTag::DescTag(C_DescTag* inTag) {
+	DescTag::DescTag(C_DescTag* inTag, bool inDeleteBase) {
 		mBaseClass = inTag;
+		mDeleteBase = inDeleteBase;
 	}
 
 	C_DescTag* DescTag::getMe() {

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -56,7 +56,7 @@
 	{
 	public:
 		DescTag(void);
-		DescTag(C_DescTag* inTag);
+		DescTag(C_DescTag* inTag, bool inDeleteBase);
 		~DescTag(void);
 		virtual String* toString();
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -44,15 +44,19 @@
 		mBaseClass = new C_HeadTag;
 	}
 
-	HeadTag::HeadTag(C_HeadTag* inTag)
+	HeadTag::HeadTag(C_HeadTag* inTag, bool inDeleteBase)
 	{
 		mBaseClass = inTag;
+		mDeleteBase = inDeleteBase;
 		
 	}
 
 	HeadTag::~HeadTag(void)
 	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+		mBaseClass = NULL;
 	}
 
 	String* HeadTag::profile() {
@@ -63,13 +67,13 @@
 	}
 	BaseTag* HeadTag::base() {
 		if (getMe()->base() != NULL) {
-			return new BaseTag(getMe()->base()->clone());
+			return new BaseTag(getMe()->base(), false);
 		} else {
 			return NULL;
 		}
 	}
 	MetaTagList* HeadTag::metaList() {
-		return new MetaTagList(getMe()->metaList()->clone());
+		return new MetaTagList(getMe()->metaList(), false);
 
 
 	}
@@ -77,7 +81,8 @@
 			//Mutators
 	void HeadTag::setProfile(String* inProfile) {
 		wchar_t* tc = Wrappers::netStrToWStr( inProfile );
-		getMe()->setProfile( tc );
+		wstring locStr = tc;
+		getMe()->setProfile( locStr );
 		Wrappers::releaseWStr( tc );
 
 	}	

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -56,7 +56,7 @@
 	{
 	public:
 		HeadTag(void);
-		HeadTag(C_HeadTag* inTag);
+		HeadTag(C_HeadTag* inTag, bool inDeleteBase);
 		virtual ~HeadTag(void);
 
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -61,12 +61,14 @@
 	//Mutators
 	void HumReadCMMLTag::setLang(String* inLang) {
 		wchar_t* tc = Wrappers::netStrToWStr( inLang );
-		getMe()->setLang( tc );
+		wstring locStr = tc;
+		getMe()->setLang( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void HumReadCMMLTag::setDirn(String* inDirn) {
 		wchar_t* tc = Wrappers::netStrToWStr( inDirn );
-		getMe()->setDirn( tc );
+		wstring locStr = tc;
+		getMe()->setDirn( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -45,11 +45,15 @@
 
 	ImageTag::~ImageTag(void)
 	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+		mBaseClass = NULL;
 	}
 
-	ImageTag::ImageTag(C_ImageTag* inTag) {
+	ImageTag::ImageTag(C_ImageTag* inTag, bool inDeleteBase) {
 		mBaseClass = inTag;
+		mDeleteBase = inDeleteBase;
 	}
 
 	//Accessors
@@ -63,12 +67,14 @@
 	//Mutators
 	void ImageTag::setSrc(String* inSrc) {
 		wchar_t* tc = Wrappers::netStrToWStr( inSrc );
-		getMe()->setSrc( tc );
+		wstring locStr = tc;
+		getMe()->setSrc( locStr );
 		Wrappers::releaseWStr( tc );		
 	}
 	void ImageTag::setAlt(String* inAlt) {
 		wchar_t* tc = Wrappers::netStrToWStr( inAlt );
-		getMe()->setAlt( tc );
+		wstring locStr = tc;
+		getMe()->setAlt( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -54,7 +54,7 @@
 	{
 	public:
 		ImageTag(void);
-		ImageTag(C_ImageTag* inTag);
+		ImageTag(C_ImageTag* inTag, bool inDeleteBase);
 		virtual ~ImageTag(void);
 
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -81,32 +81,38 @@
 	//Mutators
 	void ImportTag::setGranuleRate(String* inGranuleRate) {
 		wchar_t* tc = Wrappers::netStrToWStr( inGranuleRate );
-		getMe()->setGranuleRate( tc );
+		wstring locStr = tc;
+		getMe()->setGranuleRate( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void ImportTag::setContentType(String* inContentType) {
 		wchar_t* tc = Wrappers::netStrToWStr( inContentType );
-		getMe()->setContentType( tc );
+		wstring locStr = tc;
+		getMe()->setContentType( locStr );
 		Wrappers::releaseWStr( tc );		
 	}
 	void ImportTag::setSrc(String* inSrc) {
 		wchar_t* tc = Wrappers::netStrToWStr( inSrc );
-		getMe()->setSrc( tc );
+		wstring locStr = tc;
+		getMe()->setSrc( locStr );
 		Wrappers::releaseWStr( tc );		
 	}
 	void ImportTag::setStart(String* inStart) {
 		wchar_t* tc = Wrappers::netStrToWStr( inStart );
-		getMe()->setStart( tc );
+		wstring locStr = tc;
+		getMe()->setStart( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void ImportTag::setEnd(String* inEnd) {
 		wchar_t* tc = Wrappers::netStrToWStr( inEnd );
-		getMe()->setEnd( tc );
+		wstring locStr = tc;
+		getMe()->setEnd( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void ImportTag::setTitle(String* inTitle) {
 		wchar_t* tc = Wrappers::netStrToWStr( inTitle );
-		getMe()->setTitle( tc );
+		wstring locStr = tc;
+		getMe()->setTitle( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void ImportTag::setParamList(ParamTagList* inParamList) {

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -66,13 +66,15 @@
 	//Mutators
 	void MappedTag::setName(String* inName) {
 		wchar_t* tc = Wrappers::netStrToWStr( inName );
-		getMe()->setName( tc );
+		wstring locStr = tc;
+		getMe()->setName( locStr );
 		Wrappers::releaseWStr( tc );
 
 	}
 	void MappedTag::setContent(String* inContent) {
 		wchar_t* tc = Wrappers::netStrToWStr( inContent );
-		getMe()->setContent( tc );
+		wstring locStr = tc;
+		getMe()->setContent( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -52,7 +52,8 @@
 
 	String* MappedTagList::getContent(String* inName) {
 		wchar_t* tc = Wrappers::netStrToWStr( inName );
-		String* ts = Wrappers::WStrToNetStr( mBaseClass->getContent(tc).c_str() );
+		wstring locStr = tc;
+		String* ts = Wrappers::WStrToNetStr( mBaseClass->getContent(locStr).c_str() );
 		Wrappers::releaseWStr( tc );
 		return ts;
 	}

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -59,6 +59,7 @@
 
 	protected:
 		C_MappedTagList* mBaseClass;
+		bool mDeleteBase;
 	};
 
 }

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -64,7 +64,8 @@
 	//Mutators
 	void MetaTag::setScheme(String* inScheme) {
 		wchar_t* tc = Wrappers::netStrToWStr( inScheme );
-		getMe()->setScheme( tc );
+		wstring locStr = tc;
+		getMe()->setScheme( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -43,14 +43,18 @@
 		mBaseClass = new C_MetaTagList;
 	}
 
-	MetaTagList::MetaTagList(C_MetaTagList* inList)
+	MetaTagList::MetaTagList(C_MetaTagList* inList, bool inDeleteBase)
 	{
 		mBaseClass = inList;
+		mDeleteBase = inDeleteBase;
 	}
 
 	MetaTagList::~MetaTagList(void)
 	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+		mBaseClass = NULL;
 	}
 
 
@@ -60,8 +64,11 @@
 	void MetaTagList::addTag(String* inName, String* inContent) {
 		wchar_t* tc1 = Wrappers::netStrToWStr( inName );
 		wchar_t* tc2 = Wrappers::netStrToWStr( inContent );
+
+		wstring locStr1 = tc1;
+		wstring locStr2 = tc2;
 		
-		getMe()->addTag(tc1, tc2);
+		getMe()->addTag(locStr1, locStr2);
 
 		Wrappers::releaseWStr( tc2 );
 		Wrappers::releaseWStr( tc1 );
@@ -77,8 +84,8 @@
 	}
 	MetaTag* MetaTagList::getTag(String* inName) {
 		wchar_t* tc = Wrappers::netStrToWStr( inName );
-		
-		MetaTag* retVal = new MetaTag(getMe()->getTag(tc));
+		wstring locStr = tc;
+		MetaTag* retVal = new MetaTag(getMe()->getTag(locStr));
 		Wrappers::releaseWStr( tc );
 		return retVal;
 
@@ -86,7 +93,8 @@
 
 	String* MetaTagList::getContent(String* inName) {
 		wchar_t* tc = Wrappers::netStrToWStr( inName );
-		String* ts = Wrappers::WStrToNetStr(getMe()->getContent(tc).c_str());
+		wstring locStr = tc;
+		String* ts = Wrappers::WStrToNetStr(getMe()->getContent(locStr).c_str());
 		Wrappers::releaseWStr( tc );
 		return ts;
 	}

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -54,7 +54,7 @@
 	{
 	public:
 		MetaTagList(void);
-		MetaTagList(C_MetaTagList* inTag);
+		MetaTagList(C_MetaTagList* inTag, bool inDeleteBase);
 		virtual ~MetaTagList(void);
 
 		void addTag(MetaTag* inTag);

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -43,15 +43,19 @@
 		mBaseClass = new C_StreamTag;
 	}
 
-	StreamTag::StreamTag(C_StreamTag* inTag)
+	StreamTag::StreamTag(C_StreamTag* inTag, bool inDeleteBase)
 	{
 	
 		mBaseClass = inTag;
+		mDeleteBase = inDeleteBase;
 	}
 
 	StreamTag::~StreamTag(void)
 	{
-		delete mBaseClass;
+		if (mDeleteBase) {
+			delete mBaseClass;
+		}
+		mBaseClass = NULL;
 	}
 
 			//Accessors
@@ -69,13 +73,15 @@
 			//Mutators
 	void StreamTag::setTimebase(String* inTimebase) {
 		wchar_t* tc = Wrappers::netStrToWStr( inTimebase );
-		getMe()->setTimebase( tc );
+		wstring locStr = tc;
+		getMe()->setTimebase( locStr );
 		Wrappers::releaseWStr( tc );		
 
 	}
 	void StreamTag::setUtc(String* inUtc) {
 		wchar_t* tc = Wrappers::netStrToWStr( inUtc );
-		getMe()->setUtc( tc );
+		wstring locStr = tc;
+		getMe()->setUtc( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 	void StreamTag::setImportList(ImportTagList* inTagList) {

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -56,7 +56,7 @@
 	{
 	public:
 		StreamTag(void);
-		StreamTag(C_StreamTag* inTag);
+		StreamTag(C_StreamTag* inTag, bool inDeleteBase);
 		virtual ~StreamTag(void);
 
 		//Accessors

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h	2004-12-06 10:45:10 UTC (rev 8335)
@@ -61,6 +61,7 @@
 
 	protected:
 		C_TagList* mBaseClass;
+		bool mDeleteBase;
 	};
 }
 }

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -57,7 +57,8 @@
 	//Mutators
 	void TextFieldTag::setText(String* inText) {
 		wchar_t* tc = Wrappers::netStrToWStr( inText );
-		getMe()->setText( tc );
+		wstring locStr = tc;
+		getMe()->setText( locStr );
 		Wrappers::releaseWStr( tc );
 	}
 }

Modified: trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -74,7 +74,8 @@
 
 	String* Wrappers::WStrToNetStr(const wchar_t* inWStr) {
 		String* retStr;
-		retStr = Marshal::PtrToStringUni((wchar_t*)inWStr);
+		//retStr = Marshal::PtrToStringUni((wchar_t*)inWStr);
+		retStr = new String(inWStr);
 		return retStr;
 	}
 

Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp	2004-12-06 08:04:46 UTC (rev 8334)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp	2004-12-06 10:45:10 UTC (rev 8335)
@@ -47,7 +47,7 @@
 }
 bool CMMLCallbackProxy::clipCallback(C_ClipTag* inClipTag) {
 	if (mDNCMMLCallbacks != NULL) {
-		gcroot<ClipTag*> locClip = new ClipTag(inClipTag->clone());
+		gcroot<ClipTag*> locClip = new ClipTag(inClipTag->clone(), true);
 	
 		return mDNCMMLCallbacks->clipCallback(locClip);
 	} else {
@@ -56,7 +56,7 @@
 }
 bool CMMLCallbackProxy::headCallback(C_HeadTag* inHeadTag) {
 	if (mDNCMMLCallbacks != NULL) {
-		gcroot<HeadTag*> locHead = new HeadTag(inHeadTag->clone());
+		gcroot<HeadTag*> locHead = new HeadTag(inHeadTag->clone(), true);
 	
 		return mDNCMMLCallbacks->headCallback(locHead);
 	} else {



More information about the commits mailing list