[xiph-commits] r8624 - trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Wed Jan 5 05:42:07 PST 2005


Author: illiminable
Date: 2005-01-05 05:42:07 -0800 (Wed, 05 Jan 2005)
New Revision: 8624

Modified:
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h
Log:
* Add a deep copy clone to the .net class, which really deep copies the native class and puts a new wrapper around that, otherwise we can't hold onto this clip past the lifetime of the document it belongs to since the garbage collector will trash the document in .NET trigger the deletion of the contained native class.

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp	2005-01-05 13:23:46 UTC (rev 8623)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp	2005-01-05 13:42:07 UTC (rev 8624)
@@ -48,6 +48,11 @@
 		mBaseClass = inTag;
 		mDeleteBase = inDeleteBase;
 	}
+
+	ClipTag* ClipTag::clone()
+	{
+		return new ClipTag(getMe()->clone(), true);
+	}
 	ClipTag::~ClipTag(void)
 	{
 		delete mBaseClass;

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h	2005-01-05 13:23:46 UTC (rev 8623)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h	2005-01-05 13:42:07 UTC (rev 8624)
@@ -84,6 +84,8 @@
 		//Others
 		virtual String* toString();
 
+		virtual ClipTag* clone();
+
 	
 		C_ClipTag* getMe();
 	};



More information about the commits mailing list