[xiph-commits] r8679 - in trunk/oggdsf/src/lib/core/directshow: dsfAnxMux dsfOggMux

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Jan 8 10:56:10 PST 2005


Author: illiminable
Date: 2005-01-08 10:56:10 -0800 (Sat, 08 Jan 2005)
New Revision: 8679

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
Log:
* Fix the same COM leak in the annodex muxer.
* NULL the seek delegate because we didn't addref it, we don't want it to get relased.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp	2005-01-08 18:25:40 UTC (rev 8678)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp	2005-01-08 18:56:10 UTC (rev 8679)
@@ -75,9 +75,14 @@
 	mInputPins.push_back(new AnxMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
 
 
-		//Make our delegate pin[0], the top pin... we send all out requests there.
-	IMediaSeeking* locSeeker = NULL;
-	mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+	//	//Make our delegate pin[0], the top pin... we send all out requests there.
+	//IMediaSeeking* locSeeker = NULL;
+	//mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+	//SetDelegate(locSeeker);
+	
+	//To avoid a circular reference... we do this without the addref.
+	// This is safe because we control the lifetime of this pin, and it won't be deleted until we are.
+	IMediaSeeking* locSeeker = (IMediaSeeking*)mInputPins[0];
 	SetDelegate(locSeeker);
 }
 

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h	2005-01-08 18:25:40 UTC (rev 8678)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h	2005-01-08 18:56:10 UTC (rev 8679)
@@ -41,7 +41,7 @@
 {
 public:
 	AnxMuxFilter(void);
-	~AnxMuxFilter(void);
+	virtual ~AnxMuxFilter(void);
 
 	//Com Stuff
 	DECLARE_IUNKNOWN

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2005-01-08 18:25:40 UTC (rev 8678)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2005-01-08 18:56:10 UTC (rev 8679)
@@ -172,6 +172,9 @@
 	//DbgLog((LOG_ERROR, 1, TEXT("****************** DESTRUCTOR **********************")));
 
 	//ReleaseDelegate();
+
+	//This is not a leak !! We just don't want it to be released... we never addreffed it.. see constructor.
+	SetDelegate(NULL);
 	
 	delete mInterleaver;
 	for (size_t i = 0; i < mInputPins.size(); i++) {



More information about the commits mailing list